I can't open JS files in Windows from Filezilla - javascript

I logged in to my FTP from Filezilla and tried to open a JS file, and it gave me the following error:
Script: C:/.../slider.js
Line: 1
Char: 1
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
I have jQuery linked to the .php file as well...'document' comes from:
$(document).ready(function() {
//Code is here...
});
I tried downloading the file and opening it, I tried removing the $(document).ready();, I tried removing jquery (which by the way, when I opened the jQuery file it gave me the same almost the same error). Any help is appreciated. Thanks!
EDIT:
One of the tags for this post was "asp.net", but to be honest I don't even know if it is related to asp.net...

I had the same issue and fixed it by doing the following in Filezilla:
Go to Edit > Settings
Go to the 'File editing' section
Under 'Default Editor': Ensure that Notepad++ is selected as your custom editor
Change the radio button from 'Use filetype associations if available' to 'Always use default editor'

You say that you're right clicking and clicking "View/Edit", and it throws that error.
The error is occurring because Windows is executing the script, and the script has a problem (because it relies on another script being loaded).
So although you may be clicking "View/Edit", and expecting that this will open the file in Notepad++, what it is actually doing is assuming that "View" means "Run the script".
Clearly, Notepad++ is not the default action for this file type, or at least it isn't according to Filezilla. Maybe the default action isn't actually set the way you think it is, or maybe it's Filezilla that isn't respecting your default action.
The solutions:
If Filezilla has an option "Open with..." that allows you to pick the program to open the file with, then use that and select Notepad++ manually. Even better, if it has the option to then make that the default, then tick it, and the problem should be solved permanently.
Alternatively, just download the file to your local machine before trying to open it.

I got this working in FileZilla by doing the following: -
Edit -> Settings
File editing -> Use custom editor [file path to notepad ++] then
|___File editing -> Filetype associations
Adding the line -> js "C:\Program Files (x86)\Notepad++\notepad++.exe"
Click OK to save changes
This will stop windows script host from attempting to run the file and open in notepad++.
While the question has effectively been identified previously in the post I hope that someone finds this 'how-to' useful.

This is not a programming problem. It's a file association problem - Windows is trying to execute your .js file instead of opening it in an Editor.
See this question on SuperUser: running-javascript-files-js
There's also some explanation of the error here.
Check your file associations again. Try restarting your machine. You will get more help if you ask this type of a question on SuperUser.

It's worked for me after adding the file association.
Edit -> Settings
File Editing -> Select Use filetype association if available checkbox.
Select Filetype Associations -> add association here
js "C:\Program Files\Sublime Text 3\sublime_text.exe"
OK
Note: change association according to your text editor application.

Just follow these steps. It is an easy one to do. Change the default file type for opening the js files.
Edit -> Settings
File editing -> Filetype associations
Adding the line -> js "C:\Program Files(x86)\Notepad++\notepad++.exe"
That's it. Finally, Click OK to save changes.
It will work afterwards.

Related

how to navigate to the source file when debugging js in google chrome

I am using the google chrome to debugging the javascript source file, now I could debbugging the output js file, but the output js file is not human friendly readable. It looks like this:
from the google chrome console, I can see the call stack, and the google chrome tips shows that the source map are avaliable. But how to navigate the the js source file with current debugging line? I already type command + P in macOS but just shows the source files, I did not know which line should to navigate. the call stack only show the output js file line number.
Next to the "Page" tab (you can make the side bar bigger or click on those two arrows, there you will find the "Filesystem tab". If you add the corresponding folder to the workspace you will be able to edit and save those files.
Here's an article that explains it in details using a python server.
(note that you can use any local server you'd like)
(note that it won't work with local files url like file:///)
If you are trying to debug your current JS file at line 23487, steps would be to-
Load URL.
Open chrome debugger tools.
Put debug point on desired line.
Reload the URL, the debugger will pause at debug point.
You can watch below video for this, specifically #10:40 timestamp.
https://www.youtube.com/watch?v=WmVEddplwbo

chrome dev tools: find which script fired JS event/error

the chrome dev tool gives me a error. actually i'm trying to get an http ressource from an https webpage :
i don't know where these files are called to change the target. i guess we can know with the chrome dev tool but can't find how. i would like to know which file is firing the call, which line... (if i get only the filename, it's fine)
someone can help ?
The blue box in the picture below represents the link to the exact line that caused the error. The format is filename:XX, where filename is the name of the file where the script originated, and XX is the line of code within that file.
Click the link to see that line of code in the Sources panel. If the file is minified, click the Format button to pretty-print it.

Delete favicon.ico file from blogger

I replaced the favicon of in my web page with the one I wanted giving reference to another page that has saved the file. But despite that works and the favicon is displayed, the website also charges the old file, which I do not want because the presence of the old file causes conflicts with the SSL certificate that I installed.
My question is: How can I remove old resident .ico file in my domain if Blogger does not allow me the option to completely remove it?
PS: Neither I can not remove the reference to the old file in the code because it does not appear explicitly but rather with javascript.
I finally get an answer for my question. Just is deleting this line code on the template:
<b:include data='blog' name='all-head-content'/>
Maybe deletes RSS reference but do you can copy it from the code before deleting the line mentioned, pressing Ctrl + U in the website and then pasting it on the template.

Microsoft JScript Runtime Error With FileZilla Client

I am usinf Filzilla Client to view/edit FTP files on my server I am able to open and edit HTMLn PHP, and CSS Files using Notepad++ or Brackets Editor but on JavaScript files I am getting this error
the js Files icons also looks different than Notepad++ or Brackets Editor which are like bwlow
Can you please let me know why this is happening?
I have set "custom editor" & check "always use defualt editor" then working for me.
https://i.stack.imgur.com/ZmDLl.png
By default the View/Edit command in FileZilla opens the file in an application associated with the file type. While you have the editor associated with .php/.css, you have a WSH runtime associated with .js, so the JavaScript files get executed.
You can override the default behavior by going to Edit > Settings > File editing.

Django filebrowser missing JS file

I am trying to use django-filebrowser. I have installed in correctly according to the instructions, but i get a JS error every time i try to upload a file.
I should note that i am able to browse to 'filebrowser/browse/', create directories etc.
The problem is that when i chose to upload a file, i can see in the html source that a file 'CollapsedFieldsets.js' is included but cannot be found.
The location of this file is supposed to be here: django-install/django/contrib/admin/media/js/admin/ but the file is nowhere to be found.
django-filebrowser references this JS file in filebrowser/templates/upload.html
The error i get is:
invalid object initializer
$('#id_file').uploadify({
That probably happens because the file in question cannot be found.
I am using Django 1.3 and that file is not included in the download.
Please help!
I may have got the same trouble some days ago when I was using django-filebrowser. I can also create the directory, but when I click the 'browse' button, it fails with the same error that you got: 'CollapsedFieldsets.js' can not be found.
at last, I found that:
MEDIA_URL = 'http://domain/static/'
FILEBROWSER_URL_FILEBROWSER_MEDIA =MEDIA_URL+ 'filebrowser/'
because the MEDIA_URL has no 'www', so when I visit my website with no 'www', the filebrowser works well; but if with 'www', I will still get the error.
I am not sure this answer is right, hope it can help you.

Categories