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.
How can I loop through all members in a JavaScript object including values that are objects.
For example, how could I loop through this (accessing the "your_name" and "your_message" for each)?
var validation_messages = {
"key_1": {
"your_name": "jimmy",
"your_msg": "hello world"
},
"key_2": {
"your_name": "billy",
"your_msg": "foo equals bar"
}
}
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.
<?php
$data = array('foo'=>'bar',
'baz'=>'boom',
'cow'=>'milk',
'php'=>'hypertext processor');
echo http_build_query($data);
/* Output:
foo=bar&baz=boom&cow=milk&php=hypertext+processor
*/
How to do similar thing in javascript,say, get the query string from the array ,and convert the array to query string?
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.
I'm compiling a list of audio + video players (flash / javascript / other) that I can embed into a website.
flowplayer: http://flowplayer.org/
jw player:
http://www.longtailvideo.com/players/
premium beat:
http://www.premiumbeat.com/flash_resources/free_flash_music_player/
xspf web player:
http://musicplayer.sourceforge.net/
yahoo media player:
http://mediaplayer.yahoo.com/
any popular ones I'm missing? (anyone know if I can skin / customize any of them to operate similar to the Windows vista volume control?)
I'm considering creating a simple remote debugging application for Javascript. Actually, I want to provide an object to Firebug Lite and let it do all the job.
So, can I get an object from one page, serialize it, send it to server and then to another browser and finally see the same results in Firebug Lite (on that other client) as I would see on the first browser (with doing "console.dir(obj)")? Is it possible to do?
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.
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 ?
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
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??
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?
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
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!
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 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?
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
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?