For instance, I have a url like this : www.mysite.com/my_app.html
How do I pass a value " Use_Id = abc " to it and use javascript to display on that page ?
I read at many tutorials that the current best practices to create a new javascript array is to use "var arr = []" instead of "var arr = new Array()".
What's the reasoning behind that?
Hi is there an equivalent ruby method to JavaScript encodeURIComponent method? i am using the URI.unescape(str) but it recognizes the "£" (after encodeURIComponent it becomes "%C2%A3") as a "?" sign. any solution's? thanks
Hi All,
Using Reflection in PHP I can dynamically create a object like so
$target = 'core_domain_Person';
$reflect = new ReflectionClass($target);
$obj = $reflect->newInstance();
I would like to replicate this same concept in JavaScript is there a way to do this out of the box? Or is there a way to replicate what Reflection is doing?
I'm aware of timing issues in Javascript, how its not exact/off by milliseconds etc, but I need something to at least attempt to do browser-based scheduling.
In terms of features, I'm thinking something along the lines of scheduling patterns described here: http://www.sauronsoftware.it/projects/cron4j/manual.php#p02
Anything out there? I've done google searches and haven't found any implementation worth nothing.
I am using javascript to populate data in a table which return everything fine. I would like to make a string bold. See code below
$tr.find('.data').val($('#txtName').val() + ' <strong>Address:<\/strong> ' + $('#txtAddress').val());
How do I make only the word "Address" bold?
How to know without having iphone and ipad, any javascript/jquery effect/plugin which is working fine on all desktop browsers, will work on iphone and ipad also?
Is it enough to check on Latest Safari for Windows? I don't have MAC OSX .My os is Windows.
Hi, I'm wondering, is it possible to collect the height of a specific div container from a separate page with JavaScript? I'm using jQuery btw and I'm in need of comparing heights of div containers.
I would like to compare two dates in javascript. I have been doing some research, but all I can find is how to return the current date. I want to compare 2 separate dates, not related to today. How do I do that.
var startDate = Date(document.form1.Textbox2);
Using Javascript I'd like to get the domain value for a specific cookie.
Is this possible? If so, how?
To clarify: I'm not looking for the value of the cookie. I'm on "subdomain.domain.com" and I need to remove a cookie whose name is known but its domain value is something like ".domain.com". In short: I'd like to get the value of ".domain.com".
Hello all,
I have a simple question:
How do I detect if a parameter passed to my javascript function is an array? I don't believe that I can test:
if (typeof paramThatCouldBeArray == 'array')
So is it possible?
How would I do it?
Thanks in advance.
I'd like to initialize an object in javascript calling directly a method that belongs to it:
var obj = (function(){
return{
init: function(){
console.log("initialized!");
},
uninit: function(x){
console.log("uninitialized!");
}
};
}).init();
//later
obj.uninit();
obj.init();
This specific example doesn't work, is there something similar?
I want to create multiple versions of print-friendly pages from a single page. I am considering to do it in this way: placing several buttons on the original page and, clicking one button will popup a new window with the same html as its parent window, but with some modifications (e.g., set display attribute of some DIV's to none).
It is possible to use javascript to do this?
How to distinguish between blank areas and non-blank areas in a webpage with JavaScript? Blank areas including:
areas that are not occupied by DOM elements.
margins, borders and paddings of DOM elements.
in javascript how to send request some url at a partcular time(e.g daily 5 pm).........
very day @5pm i have to send some request (url)e.g sending emails how to do in java script
I have the following JavaScript Array:
var jsonArray = { 'homes' :
[
{
"home_id":"203",
"price":"925",
"sqft":"1100",
"num_of_beds":"2",
"num_of_baths":"2.0",
},
{
"home_id":"59",
"price":"1425",
"sqft":"1900",
"num_of_beds":"4",
"num_of_baths":"2.5",
},
// ... (more homes) ...
]}
I want to convert this in an Array like such (pseudo code):
var newArray = new Array();
newArray.push(home_id's);
How can I do that?
Notice how the newArray only has home_ids from the big jsonArray array.
I need to stop all the javascript running on the page, but I have a limitation:
I cannot control the tags content, I am editing the page after it's being loaded.
Also, I need to remove all the variables defined by the old script that was running and stop all the intervals.
w3schools says that exceptions can be strings, integers, booleans, or objects, but the example given doesn't strike me as good practice, since exception type checking is done through string comparison. Is this the preferred method of exception handling in Javascript? Are there built-in exception types (like NullPointerException)? (if so, what are they, what kind of inheritance do they use, and are they preferred over other options?)
I have a JavaScript object like:
appointerment= {ids: '15,16,17', appointments: {'15': '12.05.2010,14,05,2010'} }
now in appointments object I want to add something like '16': '21.05.2010'
what is the best possible way to do this?
I have a string containing HTML loaded from another page, how do I extract the background property from it's body tag using Javascript?
The body tag in the string looks like this:
<body onload='init();' background='storage/images/jsb_background.jpg' link='#000000' vlink='#000000' alink='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
Thanks!