I've decided I need to improve my javascript programming skills, as well as my OO skills. I am currently reading through some books, but sometimes it's hard to get a grip on the theory without seeing some practical examples first. So, I have a theoretical question about "best practices" for the following scenario...
I would like to cr...
this is currently what i have, if the request times out there is no message returned.
$.getJSON(jsonUrl, function(data){
/*here*/
if (data.stat != "ok") { //checks if query was valid
$('#content').html('content not available');
return;
}
else {...Do Code...}
});
My question is,...
Hello,
I am writing in javascript for windows (and also in wsf using javascript and vbscript) a desktop script not for internet and not using any explorer.
I need tool for debugging (free one).
Does someone can recommend on one ?
Thanks
...
I am using the following code to remove an element from the DOM tree:
function onItemDeleted(name) {
$("#" + name).remove();
}
Would this be bad for performance since I am not indicating any parent for the element. The element is a TR contained in a TABLE element. The DOM search for this el...
in firefox when im inside a input textbox and press down the up/down arrow key it doesn't autorepeat. how can i make that happen and control how many keypress it will fire up per sec?
UPDATE: i use:
$('#search_view #search').live('keydown', function(event) {
if(event.keyCode == 40) {
// code
}
});
but it just execute t...
with firebug i only knows how to see what ajax-files are called.
i have a jquery mouse click event handler bounded to a link element.
is it possible to see what javascript code is used when clicking on an element in case you forgot if you got an event handler or other javascript code coupled to it?
...
Any free and simple WYSIWYG BBCode editors for JavaScript?
...
Why do some websites (like facebook) load scripts in an iframe?
Is this to allow the site to load more than 2 resources at a time because the iframe's resources are at different URLs?
...
What sort of selector would be I need in order to insert after the parent (divouter) of the test3 class in the example below? Thanks.
<div class='divouter'>
<div class='divinner'>
<input class=test1></input>
</div>
</div>
<div class='divouter'>
<div class='divinner'>
<input class=test2></input>
</div>
</d...
Is there any way for me to share a variable between two web workers? (Web workers are basically threads in Javascript)
In languages like c# you have:
public static string message = "";
static void Main()
{
message = "asdf";
new Thread(mythread).Run();
}
public static void mythread()
{
Console.WriteLine(message); //outputs "asdf"
}
...
I would like to open an html file locally (not fetch it from a server) and somehow ensure that the relative hrefs are turned correctly resolved. I suppose I need to convert them into absolute paths.
I played around with the html element, in the head of the document, to resolve any relative links on the page, but only had limited succe...
Hello. I have this ajax_update script that updates file.php every 60 seconds.. Now file.php outputs this after updated a table:
<div id="message" style="display: none;" onclick="closeNotice()">this works
</div>
What I am trying to do is that after file.php have updated a field in the database(points), there will come up a message like...
I have the following function, which I use (admitedly, as a hack, since I still havent understood javascript's bizzare variable scoping rules), to fetch all global variables with a known prefix, from within a script.
The function works well with FF and Google Chrome (presumbaly it would work with all Moz derivative browsers). However, I...
Hey,
Is there easy way to iterate json structure like this ?
var xstring = [ {"test1",1} ,{"test2",2} ,{"test77","aa"} ] ;
...
I'm studying for an exam on JavaScript at the moment. I've also got a little knowledge of C and Perl so I'm familiar with prefix and postfix notation in all three languages.
I did an online practice exam for it and one mistake I made was in evaluating the following code:
var x = 10;
x += x--;
Now, I thought it would evaluate to 19 be...
I'm building a small PHP/Javascript app which will do some processing for all cities in all US states. This rounds up to a total of (52 x 25583) = 1330316 or less items that will need to be processed.
The processing of each item will take about 2-3 seconds, so its possible that the user could have to stare at this page for 1-2 hours (or...
Hey Folks!
I've got a problem... I cannot localize the cause for the width-overflow...
Could anyone take a look at it?
http://sulayman.org/
I've already been watching out for reasons - but didn't find anything.
Thank you all!
...
Why doesn't this alert("Summer")?
eval('(caption="Summer";alert(caption))');
Does it have something to do with the quotes in "Summer"?
...
Hi all,
So I'm learning Javascript and all its' prototype goodness, and I am stumped over the following:
Say I have this
var Animal = function (a, b, c, d, e, f, g, h, i, j, k , l, m, n){
this.a = a;
this.b = b;
//...etc...
};
var x = new Animal(1,2,3....);
Now how do I create a Cat constructor function that inherits from ...
I have this regex which looks for %{any charactering including new lines}%:
/[%][{]\s*((.|\n|\r)*)\s*[}][%]/gm
If I test the regex on a string like "%{hey}%", the regex returns "hey" as a match.
However, if I give it "%{hey}%%{there}%", it doesn't match both "hey" and "there" seperately, it has one match"hey}%%{there".
How do I make...