external

External CSS styles cant be accessed in Google Chrome

泪湿孤枕 提交于 2019-11-28 00:12:26
So i have the following code <html> <head> <link href="style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> document.styleSheets[0].cssRules[0].style.color="blue"; </script> </head> //etc. So basically this code works in IE and Mozilla, but not in Chrome. Actually, when you run document.styleSheets[0].cssRules it returns an CSSRulesList Object(in IE and Mozilla), but in Chrome it returns null. Btw, for embedded styles this object seems to work even in Chrome. So is this feature actually not available in Chrome? If so, is there a Chrome alternative that enables you to

Any way to gracefully enforce a timeout limit when loading a slow external file via javascript?

一个人想着一个人 提交于 2019-11-28 00:02:13
问题 I'm using javascript to include some content served up from a php file on another server. However, this other service can sometimes get flaky and either take a long time to load or will not load at all. Is there a way in JS to try to get the external data for x number of seconds before failing and displaying a "please try again" message? <script type="text/javascript" src="htp://otherserver.com/myscript.php"></script> 回答1: Couple issues: you can use timeout thresholds with XMLHttpRequest (aka

Python - how do I call external python programs?

谁说我不能喝 提交于 2019-11-27 23:05:25
问题 I'll preface this by saying it's a homework assignment. I don't want code written out for me, just to be pointed in the right direction. We're able to work on a project of our choice so I'm working on a program to be a mini portfolio of everything I've written so far. So I'm going to make a program that the user will input the name of a program (chosen from a given list) and then run the chosen program within the existing shell. However, I can't really find information on how to call upon

How to load external html into a div?

天大地大妈咪最大 提交于 2019-11-27 22:27:37
I've created this little code using jquery to load an external HTML file into my div, but it doesn't work, I'm running out of ideas. Any other jquery code works well. Any help appreciated: <div id="zaladuj"> load external html file </div> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $('#zaladuj').click(function () { $(this).load('s1.htm'); }); </script> You need to wrap your code within jQuery.ready() function since you have to wait for DOM to be fully loaded. <script type="text/javascript"> $(document).ready(function(){ $('#zaladuj').click(function

read file from external storage

限于喜欢 提交于 2019-11-27 21:49:01
问题 I simply cannot find how to get one specified file from the external storage. I know that with getExternalStoragePublicDirectory(), you get the external storage directory but I can't get further. I need some kind of method where you have to give the name of the file and it returns the file. Thanx 回答1: Better than using File.separator is this, which is standard Java: final File file = new File(Environment.getExternalStorageDirectory() .getAbsolutePath(), filename); 回答2: You can just do this:

Adding external JAR to Maven project in NetBeans

大憨熊 提交于 2019-11-27 20:27:05
When I right click on my Maven project and choose the Add dependency option and I type my external jar's name in query, it is not found. How to add external jar to a Maven project? You can follow this tutorial: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html Example: Install the jar to your local maven repository: mvn install:install-file -Dfile=cxf-2.7.3.jar -DgroupId=org.apache.cxf -DartifactId=cxf-bundle -Dversion=2.7.3 -Dpackaging=jar Edit the pom.xml file in your project to include the newly added dependency: <dependency> <groupId>org.apache.cxf</groupId> <artifactId

Using $compile on external template (templateURL) in Angular directive

不羁岁月 提交于 2019-11-27 20:00:15
问题 I've got a recursive Angular directive that uses a template variable and gets compiled in the link function. Problem is, that my template has gotten really long and out of control and I want to externalize it in an external HTML file (it would also make it easier for example to auto-indent). How can you load an external template into a directive that can be used inside the $compile ? I've seen templateURL , but that doesn't let me name the variable and pass it to the $compile function. var

How to call external javascript file in PHP?

时光怂恿深爱的人放手 提交于 2019-11-27 18:54:28
问题 I am learning how to call external javascript files in my PHP code. I got some codes from the internet and tried it but its not working. Can somebody pls give me some advice or explain to me this. I am not a programmer but I am studying how to program and just started learning that's why I have difficulty understanding some concepts. I have here the codes, PHP File and JS file. They are in the same folder. Here are the codes: index.php <html> <head> <script language="JavaScript" src="exer_1

Import python module NOT on path

醉酒当歌 提交于 2019-11-27 18:06:39
I have a module foo, containing util.py and bar.py. I want to import it in IDLE or python session. How do I go about this? I could find no documentation on how to import modules not in the current directory or the default python PATH. After trying import "<full path>/foo/util.py" , and from "<full path>" import util The closest I could get was import imp imp.load_source('foo.util','C:/.../dir/dir2/foo') Which gave me Permission denied on windows 7. One way is to simply amend your path : import sys sys.path.append('C:/full/path') from foo import util,bar Note that this requires foo to be a

How do I check for the existence of an external file with XSL?

自闭症网瘾萝莉.ら 提交于 2019-11-27 17:38:24
问题 I've found a lot of examples that reference Java and C for this, but how do I, or can I, check for the existence of an external file with XSL. First, I realize that this is only a snippet, but it's part of a huge stylesheet, so I'm hoping it's enough to show my issue. <!-- Use this template for Received SMSs --> <xsl:template name="ReceivedSMS"> <!-- Set/Declare "SMSname" variable (local, evaluates per instance) --> <xsl:variable name="SMSname"> <xsl:value-of select=" following-sibling::Name"