Wordpress not loading javascript file - javascript

I have just uploaded a wordpress site from previously developing it on my localhost. On my localhost there are several plugin javascript files that are picked up and used to display a tooltip on the google map plugin for the markers.
On my localhost this all works fine but when i uploaded this through FTP, some of the javascript files appear to longer be loaded. Is there any way to check which files are being uploaded when the page is loading the javascript?
Whenever i try to check or edit the file from Filezilla, it gives a Microsoft JScript runtime error, Code: 800A1391, Error: 'document' is undefined, so i can't check that what the host uses is the exact same code as my localhost.
Many thanks,
Dan

Most browser developer toolkits (Dragonfly, Chrome Developer Tools, Firebug, etc) include a Net tab which will tell you which files have been requested and the status of them.

Try using either firebug http://getfirebug.com/ with Firefox or the Chrome web inspector and look at the (Net/Network) panel while you reload the page to see if the js files are trying to load. This should give you some insight.

Related

Edge open local .html with css and js links

I have a problem with Edge browser (40.15063.0.0 version). I try to open local html file and have an error XMLHttpRequest: Network Error 0x5, Access is denied. for jQuery library. Does anyone have the same error?
I have css and js links to bootstrap library and some another library, which are placed in the same folder in subfolders. And all of this external resources cannot be uploaded in Edge browser. In Google Chrome all works fine.
What can be the issue of this strange behavior? Also another developer can open this page on his computer.

Why CDN are disabled in local my chrome browser?

I often my test javascript snippet code using Chrome developer tools and I came up with debugging of inputing URL search bar: data:text/html, and running code chrome snippets.
This way works in Vue.js's CDN though some strange error message occurs.But,jQuery via CDN doesn't load like photo.
I want to know reason why these happens.Any tips would greatly help.
So,please give me advise if something occurs to you however it is little.
Edit:
I added photo load jquery snippets and it works in Google Home.
My html environment is reproducible only inputting your chrome browser's url_bar,data:text/html, <html contenteditable> which makes your browser html-editor and it can run javascript using script tag.
It is because your code is loading jQuery without a protocal ( http://, https:// ). The code you have loads the resource based on what your page uses for maximum security. Your page doesn't have use http:// or https:// unless it is online.
Change it to http:// and it will load, but if you're using SSL and your page is loading through https:// when online, then change it back to :// when it's online.

Download multiple images without asking in Chrome extension

I am currently creating a Chrome extension (which uses javascripts mainly) that allows users to scrape the images on a webpage and download them. I have finished the link scraping part, and the code will return an array like:
["http://example.com/image1.jpg","http://example.com/image2.jpg"]
But how do I download all of the links in ONE CLICK? I tried listing all photos on a new tab and let the users to Ctrl+S save the page. But this greatly affects the UI and I do not like it. I do not host webpage so server side script may not be working.. Any other solutions?
As far as I know, Chrome extensions technically can't save files to disk like Firefox.
The only way to do this is using NPAPI
Unfortunately, extensions using npapi will most likely not be accepted by the Web Store due to security problems. Of course it'll be okay if you use it for yourself or host the extension on your website.
You can install and examize the code of the following extensions, maybe you can even use the provided npapi too:
Screen Capture (by Google) https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg
Chrome Toolbox (by Google) https://chrome.google.com/webstore/detail/fjccknnhdnkbanjilpjddjhmkghmachn
Awesome Screenshot: Capture & Annotate https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce
Download Asisstant (by Google) - got killed I guess.

firefox addon: Talking back to the script

I am new to extension programming but find making extensions in Chrome much more easier, but now that I am trying to port my test extensions to FF I have a few questions of how to do the same things I do in Chrome... now in FF.
For example:
In Chrome I have a page in my extensions directory called: domains.html
I link to that page from my popup and it has access to all my scripts etc but the "outside" world cannot directly access that.
Is there any such thing in FF so that I can show a page that is in my add on folder and has access to my add-on's JS and other files?
Thanks!
Take a look at some of the docs for opening URLs in new Tabs and manipulating the content of the tab:
https://developer.mozilla.org/en/Code_snippets/Tabbed_browser#Opening_a_URL_in_a_new_tab
Once you get comfortable with that, try opening an HTML page that lives in your add-on. First, you need to be aware of the 'content' package name you registered in your chrome.manifest file. Second, make sure your 'domains.html' file is in the content folder of your add-on. To open the web page in a new tab using a button or menu in Firefox use code like this:
gBrowser.addTab("chrome://mypackagename/content/domains.html");
You can should be able to load other JS and CSS files from your add-on into the web page using similar chrome:// URIs.

How do you log to the error console from untrusted Javascript?

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

Categories