Search   Feed   Browse   Add
Feed items 1 - 10 of 15 for July 2008

Javascript FAQ

Answers to frequently asked questions about Javascript.

What is the difference between the script type and language attributes - (Found July 2, 2008 )

A: The script element's type attribute specifies the content type of the script, which should always be textjavascript, the standard Multipurpose Internet Mail Extensions (MIME) type for Javascript. The "text" part signifies that the script is essentially a plain text format. The "javascript" part specifies the scripting language.
http://www.codestyle.org/javascript/FAQ.shtml#scriptcodelanguage

Help request - (Found July 2, 2008 )

Use the form below to submit a help request or general enquiry about the Code Style Web site. Read our guidelines on asking the right questions first.
http://www.codestyle.org/javascript/FAQ.shtml#help

How can I create a file on the client side - (Found July 2, 2008 )

A: It is not possible to create files on the client's computer using Javascript. This type of action is excluded from the Javascript language because it would be a serious security hazard. The only form of local file storage available through Javascript is cookies, whose behaviour and contents are strictly prescribed.
http://www.codestyle.org/javascript/FAQ.shtml#createfile

Can I get the file size on the client side - (Found July 2, 2008 )

A: It is not possible to access files on a person's computer using Javascript through a Web browser, or to read the properties of files. It would be a serious security and privacy hazard if Javascript code in a Web page could read files on your computer because the information could be sent back to the site via a form or other mechanisms. For these reasons the possibility of file access was excluded when the Javascript language was designed.
http://www.codestyle.org/javascript/FAQ.shtml#nofileaccess

How can I add 7 days to a date in Javascript - (Found July 2, 2008 )

A: The example below creates a new Date object and a set of constants to calculate the number of milliseconds in 7 days. The 7 day figure is added to the original time and used to create a second Date object.
http://www.codestyle.org/javascript/FAQ.shtml#add7days

How do I get the difference between two dates in Javascript - (Found July 2, 2008 )

A: There are two elements to this question, first to find the difference between two dates and second to format the result. The code below creates three variables to represent time intervals in milliseconds, then creates two dates with specific times on the same day. This could be adapted for any two dates, including the current time using the basic Date() constructor.
http://www.codestyle.org/javascript/FAQ.shtml#javascriptdatediff

Can I get the URL of any other browser window - (Found July 2, 2008 )

A: Web browsers' Window object references only extend as far as windows in the same frameset or "child" windows spawned from a specific document. It would be a user security violation if a script could read any other window's URL because this information could be communicated back to the script's host. For instance, you could append the URL to the query parameter of a second page on the script's host, redirect to that URL and log or process the request.
http://www.codestyle.org/javascript/FAQ.shtml#windowsecurity

I get "Done, but with errors on page" in IE! - (Found July 2, 2008 )

A: The message "Done, but with errors on page" is an Internet Explorer error message that means there was a problem with one or more of the Javascript statements on the page. Normally you will see a warning icon alongside the error message in the status bar. If you double click on the icon, a status message will open to give details of the problem, which may help you fix the errors.
http://www.codestyle.org/javascript/FAQ.shtml#donewitherrors

I can't get Javascript to check for null strings correctly! - (Found July 2, 2008 )

A: It would help to see a fragment of the code. One thing to watch out for is the use of a single assignment equals instead of the double comparison equals...
http://www.codestyle.org/javascript/FAQ.shtml#assigncompare

Has the script file loaded - (Found July 2, 2008 )

To check if an external script file has loaded, add the following code to the top of the file and reload the HTML:
http://www.codestyle.org/javascript/FAQ.shtml#scriptload
Available Archives
- July (15 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact