I'm building a status page which should be refreshed periodically.
So, I've had a http-equiv refresh in the <head> section in order to refresh the page every minute :
<meta http-equiv="Refresh" id="refresh" content="60"/>
But, for browser supporting JavaScript, I would like to send an Ajax request checking if the page should be refre...
Hi
I need to insert a text/string from an input field into text area that already has some text inside. The inserted string must be in the position of the cursor, and a button for inserting is required.
Is there a way to accomplish this with JavaScript?
Thx in advance
P.S. the text/string that should be inserted is fetched from the ...
If a user is on your website and opens another link (also to your website) in a new tab, is it possible to differentiate this from the user just clicking on the link normally? This can be in javascript, on the server, whatever.
I'm guessing that the answer is that you cannot do this, but I wanted to double check.
...
I'm working on a client project and I have to include their header and footer, which includes some core javascript files. I have a couple of PNGs on the page, but their core JS file is poorly coded and doesn't check for IE 7 before attempting to replace IMG tags that contain .png files with DIVS that use the AlphaImageLoader filter. The ...
I'm using ASP.Net MVC, but this applies to any framework.
I'm making an Ajax call to my server, which most of the time returns plain old HTML, however if there is an error, I'd like it to return a JSON object with a status message (and a few other things). There doesn't appear to be a way for the dataType option in the jQuery call to h...
I'm creating a JsonArray such as:
JsonArray jsonValues = new JsonArray();
for( int i = 0; i < values.Count; i++ )
{
var someSingleValue = values[i];
jsonValues.Add( string.Format( "Name: {0}", someSingleValue ) );
}
After that I'm shipping json values to my javascript in .aspx page via call:
HtmlPage.Window.Invoke("call", js...
Try executing the following in JavaScript:
parseInt('01'); //equals 1
parseInt('02'); //equals 2
parseInt('03'); //equals 3
parseInt('04'); //equals 4
parseInt('05'); //equals 5
parseInt('06'); //equals 6
parseInt('07'); //equals 7
parseInt('08'); //equals 0 !!
parseInt('09'); //equals 0 !!
JavaScript, I just learned (the hard way), t...
Here is what I am trying to do. I have about 160 places of interest. The user enters their address (postcode, full address, whatever) which I use Google to geo-encode. I then create a Google map centred about this point and I add a marker for each of my points of interest to the map (using a MarkerManager). So far so good.
I want to dis...
I'm working on a bookmarklet, and thought I'd throw down a challenge: how to inject an external javascript file from a link in as few characters as possible.
Here's the shortest I was able to come up with:
javascript:(function(d){d.body.appendChild(d.createElement('script')).src='URL'})(document)
That's 88 characters without the URL....
I’m writing a web site targeted at the iPhone. I’d like to set a class on the <body> element when the iPhone’s orientation changes (i.e. when the user turns the phone into landscape and/or portait mode).
Can I detect this change via JavaScript? Is there an event for this?
...
Hello there! I'm working on a web app which will need to work offline. I'm looking at Gears right now, but I also found Dojo offline. I'm asking this question because the latest news of it are from 2007, and the hosted demos don't seem to work (I've installed Gears under Firefox 3.0 on my Ubuntu laptop)
Is anyone using Dojo offline, or a...
I am using an ExternalInterface call on activate from a flex application embedded within my html document. The call goes to a javascript function which does
function documentFocus() {
this.focus();
}
Everything works like a charm, except that Firefox does not focus the document body 100%. It stops listening for onkeyup events (it st...
I've seen a lot of this...
function myObject(data) {
var myData = data;
}
myObject.prototype.doSomething = function () {
alert("I did something!");
}
but the intellisense on Visual Studio gives me a .constructor for functions, which would lead me to believe this would be correct...
function myObject() {
var myData;...
Hi, I have a system that loads a div with content through the use of AJAX. All is well, I can get the div to load perfectly with details from my database and it works great. The problem is this: Inside the returned div, I have a couple of buttons with onclick events. The onclick events cause an error when I attempt to call a user defined...
how to generate tinymce to ajax generated textarea
Any help?
...
I am trying to succeed at getting this jquery plugin to work corretly. What I need is a click event that will alow me to click a row and have a js window that will load another page using the row_id that is the primary key in the database. I'm really lost with javascript but I like the plugin and really would like to have this work if po...
I'd like to embed an html tag in Javascript, between the script> tag
Thanks
...
Hi,
I am new in Jquery.
I want to use sortableUI to my datalist. Each row in datalist contains
text with serial number. I have used sortable ui successfully. But now
I want move the text not the serial number while sorting.
Here is my Example Code. The div displays the serial number at the
top-left corner of each li. Now If I try to st...
In my div i have a child div of class "someClass". I want to access that child by classname, not id.
EDIT: Only in this particular div, not all the other divs with same classname
...
Ok so I don't understand why Firefox is saying that the $("#canvas")[0].getContext('2d'); is undefined. I put it out of the function so that all of the function can access it but here the ctx is still undefined.
(function($) {
// Undefined
var ctx = $('#canvas')[0].getContext("2d");
var x = 150;
var y = 150;
...