I am not exactly certain what I did to cause this, but I have been able to, up until a couple of minutes ago,debug my javaScript file(referenced using a script tag in a .aspx page I am working with) using FireFox firebug tools. Suddenly, I am unable to view the file via the FireFox script tab list. I scroll the list of script files included in my page, but I do not see the particular Javascript file I expect to be on the list. I am however, able to confirm that the JavaScript file is loaded along with the page information, under the HTML tag in firefox.
**No Javascript on this page**
If <script> tags have a "type" attribute, it should equal "text/javascript" or "application/javascript". Also scripts must be parsable (syntactically correct).
I experience similar problem when using chrome. When I pull up the entirely loaded file, I am able to confirm that my javaScript file is correctly referenced. But for some reason I am unable to verify the script is being run or debug it.
The rest of the web application works file. Problem is just with the one page.
ONE SOLUTION
I created a new aspx file. Copied over the code from the faulty page and ran it, and it worked fine on both Firefox and chrome.
Related
I have created a chrome extension, designed to collect the email address of the user signed into the browser, which works perfectly. The problem is that the extension must be clicked on to run; I am trying to get it to work so that it runs automatically without any user interaction necessary... is this possible?
Currently, my extension runs a HTML file when clicked on, which in turn calls a JS script coded to collect the email address. The code inserts this into the HTML and posts it to a PHP file. I have tried using chrome.runtime.onStartup.addListener(function() {}); within the js script but this does not work. Note: my JS script is not a service_worker, I do not know how I could get a service_worker script to run my other JS script.
If anyone can help, thanks!
I'm new to Chrome extensions, and don't need a lot from an extension, so I haven't studied JS or the HTML5 Chrome API in great detail (however, I do know HTML). Other pages in Stackoverflow were not quite what I was looking for.
Basically, I am writing a program that will take HTML page source data and parse certain information out of it for use with another program. What I need to be able to do is use a Chrome extension to get the source of a web page, then save it to a local HTML file for the program to use.
I'm using most of the extension source code from this thread: Getting the source HTML of the current page from chrome extension
This works very well, except I need the source to go to a local file and not in the popup. In the popup, I'm going to add in a message like "File saved" along with a button to open the external program (if that's even possible). Any help or a step in the right direction would be greatly appreciated.
I have a very strange problem with IE9 and an iFrame I've implemanted inside an aspx page
the iFrame is connected to a login page of a different website and when i try to log in with username and password, the login page that supposed to call several js methods on external js files, well, doesn't call them
naturally, I've checked this page in FF and Chrome and it works perfectly but IE9 (and IE9 with competability mode) cant seems to "see" these js files
I opened IE tools (F12) and looked in the "script" tab, the external script weren't there
I've tried to link the scripts in my aspx file and it didn't help either
so what do you say
why is IE9 can't use js files inside an iFrame
In Chromium, 'console.log()' lets you print to the error console, but only from javascript embedded in the html, or in a .js file on the local machine.
What are your workarounds for debugging Javascript that is contained in .js files on a remote machine and included in a page?
Add breakpoints and / or watch expressions.
See http://code.google.com/chrome/devtools/docs/scripts-breakpoints.html
I recently had to do this with a Facebook SDK javascript, hosted by Facebook. I downloaded the script and hosted it locally for debugging. I could then add in all the console.log messages I wanted.
When everything was done I removed the local file and returned to Facebook's hosted script.
Phil's suggestion of breakpoints is also very useful when you want the value of a variable at a specific location in the code.
Another useful technique for code executed upon a user action, such as a button click, is to use the Scripts tab of the Chrome inspector, or FireBug in FF, to edit the javascript prior to execution. I've had limited use for this, but it's quite useful from time to time.
The problem is cross-domain security policy. Only javascript from the domain of the html file can use console.log
I am writing an application on XULRunner that displays HTML pages from the web:
I have a very simple XUL file with a in which is just a filling the window and loading a local HTML file.
In my HTML, I have an iframe to load content.
What's cool with XULRunner is that I can access the content of the iframe for many things (display page title, images...)
What's not cool at all is that, unlike what I had when my app was running in a browser, I have two big bugs with some pages:
1) Some (many?) pages (like "yahoo.fr" have malformed HTML content, especially for tag where the tag is not closed (the IMG tag without the /> at the end).
==> This does not bother Firefox but in my app, XULRunner does not decode the HTML and thus display the rough HTML source code in the page.
2) On some pages, like, for now, the home of nytimes.com, the login page of bloglines.com and of yahoo.fr, "something" happens in the iframe that causes the src of my tag (that is my app that SHOULD NEVER CHANGE) to change thus closing my app.
==> I guess it may be linked to an attempt to open in another window.
Does anyone have a clue to solve these two problems? Better version of XULRunner (I am using 1.9.1)? XUL options to prevent a page to open in new window? Others?
Thanks for your help,
J.
Rather than a <iframe/>, use a <browser type="content-primary"/>. That will solve your second problem (by letting the system know that the contents of that frame belongs to the web and shouldn't be able to change you).
The first question really depends on how things are being loaded. Are they from http, or from a previously-saved local file? Do you useful mime types and things from the server? Or, if local, what file extension do you end up with?