Why do I never see the prototype property in JavaScript code I edit, from books and documentation I've read, it seems to be a cornerstone of the language.
Possible Duplicates:
Do you recommend using semicolons after every statement in JavaScript?
Why use semicolon?
What are the ups and downs of using semicolons to end commands in JavaSript? What are the arguments for and against doing so?
Do .htc style behaviours still work if javascript is disabled?
I'd like to use whatever:hover to create some css only drodpowns and would like to know if IE will still pay attention to the htc file if js is disabled.
Many thanks
I want to make an "Open File" button to import txt files contents into a textarea.
How can I read the file contents without uploading it to the server?
I want to use javascript (with jquery lib) and I want to do it without refreshing the page.
How do I set up a listener in jQuery/javascript to monitor a if a value in the textbox has changed? The value is fed into the textbox by a scanner,so each time an item is scanned the value in the textbox changes.I need to display some information based on the value in the textbox.
I am currently investigating options for working with the canvas in a new HTML 5 application, and was wondering what is the current state of the art in HTML canvas JavaScript libraries and frameworks?
In particular, are there frameworks that support the kind of things needed for game development - complex animation, managing scene graphs, handling events and user interactions?
Also willing to consider both commercial and open source products.
They are very different kind of languages and the way they handle exception might be pretty different.. How is exception handling implemented and what are the implementation difference within these languages?
I am asking this question also because I noticed that C++ exception handling seems to be very slow compared to the JavaScript version.
We need to clear the authentication cache in IE with Javascript. On IE6 we use: document.execCommand('ClearAuthenticationCache'); and it works. On IE7 it doesnt work.
what can i do? thanks...
I've recently read the Yahoo manifesto Best Practices for Speeding Up Your Web Site. They recommend to put the javascript inclusion at the bottom of the HTML code when we can.
But where exactly and when ?
Should we put it before closing </html> or after ? And above all, when should we still put it in the <head> section ?
When initializing a new Date object in JavaScript using the below call, I found out that the month argument counts starting from zero.
new Date(2010, 3, 1); // that's the 1st April 2010!
Why does the month argument start from 0? On the other hand, the day of the month argument (last one) is a number from 1 to 31. Are there good reasons for this?
Do anyone know how do use javascript to redirect user login using Google Accounts?
I know there is "users.create_login_url(self.request.path)" but how do that integrated to "`window.location"
Or there is alternative??
What is the recommended way to zerofill a value in JavaScript? I imagine I could build a custom function to pad zeros on to a typecasted value, but I'm wondering if there is a more direct way to do this?
Note: By "zerofilled" I mean it in the database sense of the word (where a 6-digit zerofilled representation of the number 5 would be "000005").
I have a window I'm opening with a Javascript function:
function newwindow()
{
window.open('link.html','','width=,height=,resizable=no');
}
I need it that once the new window opens that the focus returns to the original window.
How can I do that?
And where do I put the code - in the new window, or the old one?
Thanks!
In javascript, how would you check if an object is actually visible. I don't just mean checking the visibility and display attributes. I mean, checking that the element is not
visibility:hidden or display:none
underneath another element
scrolled off the edge of the screen.
EDIT: For technical reasons, I can't include any scripts. I can however use prototype as it is on the page already.
EDIT 2: This is no longer neccesary, but I'd still find an answer interesting)
I've noticed that the brightness of computer monitors drastically varies between computers.
As such, this changes the look of web pages greatly.
Is there a way to use JavaScript to automatically detect how bright (or dark) a users monitor is so that I can adjust my web page colors accordingly?
UPDATE
Please note that I do not want manual user involvement. I want this detection to be automatic so that users don't realize I dynamically change the color palette automatically based on the brightness/darkness of their monitor.
Hi guys,
Is there any javascript to disable "export to microsoft excel option" on right click in browser. though it can be done using web.config, but there is this need to do it using js.
TIA
Bibhu
I have a JavaScript class that has a method:
function someClass() {
this.someMethod = someClass_someMethod;
}
function someClass_someMethod() {
// make an AJAX request
}
The problem is that someClass_someMethod() needs to return the value of the AJAX request.
I'm using jQuery's $.getJSON() method to fetch the data. The data needs to be returned but it seems the only way to get the data is through a callback.
How can this be done?
I have input checkbox something like this..
<input class="inputchbox" id="Pchk" type="checkbox" name="check" value="<%=Model.ID%>" />
using javascript I need to get the all checkbox checked Ids in to the array?
how do I need to get?
thanks
At the moment to get to an external link from our intranet, we have to copy the link, and paste the link into a new window. Is there any way we can achieve this in a single function in javascript?
Thanks
I need to get the date in a specific locale using JavaScript - not necessarily the user's locale. How can I do this?
I did some research and found date.getUTCMonth() and date.getUTCDate(). How can I use this or something else to get the date in a certain locale?
How to detect ctrl+v ,Ctrl+c using Javascript?
i need to restrict pasting in my textareas,end user should not copy and paste the content,
user should only type text in text area.
how to achive this.
Thanks in advance.
The 'K&R', 'Red Book', 'Camel' of JavaScript and CSS? When you see a site like www.cmegroup.com or www.gs.com, what reading material do the developers likely have on their shelves?
I would like to check whether a variable is either an array or a single value in JavaScript.
I have found a possible solution...
if (variable.constructor == Array)...
Is this the best way this can be done?