external

Call external JS file based on “media screen” value

若如初见. 提交于 2019-11-26 11:23:46
问题 I\'m trying this but it is not working: <html> <head> <script src=\"js/menu-collapser.js\" type=\"text/javascript\" media=\"media screen and (max-width: 599px)\"></script> </head> ... </html> //menu-collapser.js : jQuery(document).ready(function($){ $(\'.main-navigation li ul\').hide(); $(\'.main-navigation li\').has(\'ul\').click(function() { $(this).children().toggle(); }); }); Do you have an idea on how to do this in the right way? The script work if used directly in the header with the

Cannot load an external page with jQuery.load into a div in my page

元气小坏坏 提交于 2019-11-26 11:14:56
问题 I am not able to load an external html page into a div in my page. My Jquery Code is: $(document).ready(function(){ var url = \'http://www.google.com\'; $.get(url, function(response) { $(\'div#external\').html(response); }); }); My HTML page is <html><body><div id=\"external\"></div></body></html> I also tried using another JQuery code $(document).ready(function() { $(\'#external\').load(\'http://google.com\'); }); Could anyone please help me. Thanks Amal 回答1: Due to browser restrictions,

Externalizing Grails Datasource configuration

拟墨画扇 提交于 2019-11-26 07:27:28
问题 Grails 1.x allows using external configuration files by setting the grails.config.locations directive. Is there a similar approach available for externalizing the database configuration in Datasource.groovy (without setting up JNDI)? It would prove helpful to be able to configure DB credentials in a simple configuration file outside the application. Thanks in advance! 回答1: You can use a properties file specified in the grails.config.locations as a way to externalize the datasource

How to set up a git project to use an external repo submodule?

孤者浪人 提交于 2019-11-26 06:50:48
问题 I\'d like to create a repo which pulls in a remote repo. For example, let\'s say jQuery as a submodule: git://github.com/jquery/jquery.git What would be the process of creating a repo with jQuery as a submodule and adding my own external as a remote repo. Also once this is setup, if I push / pull to my own remote, will the external remain intact? 回答1: You have a project -- call it MyWebApp that already has a github repo You want to use the jquery repository in your project You want to pull

How to style SVG with external CSS?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 05:55:50
问题 I have several SVG graphics I\'d like to modify the colors of via my external style sheets - not directly within each SVG file. I\'m not putting the graphics in-line, but storing them in my images folder and pointing to them. I have implemented them in this way to allow tooltips to work, and I also wrapped each in an <a> tag to allow a link. <a href=\'http://youtube.com/...\' target=\'_blank\'><img class=\'socIcon\' src=\'images/socYouTube.svg\' title=\'View my videos on YouTube\' alt=\

How to open/display documents(.pdf, .doc) without external app?

不羁岁月 提交于 2019-11-26 04:41:33
问题 I want to create a program, that open documents without external app. I need this, because i want to scroll the document with the phones orientation(Pitch and Roll). I create a button on the bottom of the screen, and when i hold down the button, i can scroll the document too. If i release the button, i can\'t scroll it. So, if i open the document with external app, my button disappears, and the sensorManager works neither. Have someone any idea to solve this problem. Or have someone any idea,

Access PHP var from external javascript file

a 夏天 提交于 2019-11-26 03:10:22
问题 I can access a PHP var with Javascript like this: <?php $fruit = \"apple\"; $color = \"red\"; ?> <script type=\"text/javascript\"> alert(\"fruit: \" + \"<?php echo $fruit; ?>\"); // or shortcut \"<?= $fruit ?>\" </script> But what if I want to use an external JS file: <script type=\"text/javascript\" src=\"externaljs.js\"></script> externaljs.js: alert(\"color: \" + \"<?php echo $color; ?>\"); 回答1: You don't really access it, you insert it into the javascript code when you serve the page.

Obtaining Facelets templates/files from an external filesystem or database

…衆ロ難τιáo~ 提交于 2019-11-26 01:46:05
问题 I am able to successfully get this to work with the template in my app: <ui:decorate template=\"/WEB-INF/templates/mytemplate.xhtml\"> I am also able to move template to /META-INF/templates/mytemplate.xhtml of a JAR and get this to work: <ui:decorate template=\"/templates/mytemplate.xhtml\"> I would actually like to put this file onto filesystem (or database for that matter). How can I achieve this? I found plenty of things related to com.sun.facelets.impl.DefaultResourceResolver , but I don\

Eclipse: How to build an executable jar with external jar?

自古美人都是妖i 提交于 2019-11-26 00:43:12
问题 I am trying to build an executable jar program which depends on external jar downloaded. In my project, I included them in the build path and can be run and debug within eclipse. When I tried to export it to a jar, I can run the program but I can\'t when I try to press a button which includes function calls and classes from the external jar. I have edited the environment variables (Windows XP) CLASSPATH to include paths of all the external jar, but it doesn\'t work. A point to note is that I

Android saving file to external storage

ⅰ亾dé卋堺 提交于 2019-11-26 00:00:03
问题 I have a little issue with creating a directory and saving a file to it on my android application. I\'m using this piece of code to do this : String filename = \"MyApp/MediaTag/MediaTag-\"+objectId+\".png\"; File file = new File(Environment.getExternalStorageDirectory(), filename); FileOutputStream fos; fos = new FileOutputStream(file); fos.write(mediaTagBuffer); fos.flush(); fos.close(); But it\'s throwing an exception : java.io.FileNotFoundException: /mnt/sdcard/MyApp/MediaCard/MediaCard-0