I have a big multidimensional array that holds references to objects and I need to be able to move a reference from one spot in the array to another and then delete the original reference (or set it to undefined). The problem with this is it then deletes the recent reference.
var data = [[new Obj, new Obj], [new Obj, new Obj]];
functio...
I have multiple instances of a div with an id of "myDiv" on a page. I want to replace the contents of these divs. When I use this javascript:
function replaceContent(id, content) {
var container = document.getElementById(id);
container.innerHTML = content;
}
replaceContent('myDiv', 'hello there');
<div id="myDiv"></div>
<div ...
How to rewrite the code using jQuery?
<script type="text/javascript">
window.onload = function(){
var array = document.getElementsByTagName('div');
for (var i=0; i<array.length; i++) {
(function(i) {
array[i].onclick = function() {
alert(i);
}
...
Hi there,
i have a navigation menu and i am using the hover element to change the image when an hover event occur. i am using the following CSS
#navigation li.contact a:hover {
margin-left:1px;
background: url('../img/hover.jpg') no-repeat;
float:left;
width:147px;
height:109px;
}
my navigation menu is composed o...
Hi ,
I understand that google analytics uses first party cookie tracking, so it sets the cookie from the domain being visited with javascript (rather than setting the cookie from google-analytics.com)
I am wondering how the ga.js google analytics script saves the cookie data to the database to be reported on by google analytics?
I can...
Hi Guys,
I have a function doing the following using javascript:
Create link element and set href=cssFile.
Insert the link element in head tag.
Create a div element.
Set the class name using setAttribute
appendChild the div on body.
Now getting CSS rule value using document.defaultView.getComputedStyle(divElement, null)[cssRule].
No...
I wonder if there is a comparison between the features of various regex metacharacters in various implementations.
The sort of thing I am looking for is a table like
Language Perl sed
grouping ( ) \( \)
Languages I am interested in are Perl, Sed Java Javascript
...
Hi,
I have this website using "jQuery Coda Slider" but the slider is not working in IE7.
It works with no JavaScript errors both on IE8, Firefox and Google Chrome, but not on IE7.
Can you please help me?
The website's at http://portelaresidence.com/ .
Thanks in advance for your help.
...
How could I prevent my page displaying an unstyled view while the page is loading ?
I think its probably because of the order of loading different JavaScript-files.
Is there a best-practice, for example loading plugins before my own code ?
Should every jQuery/.js-function called after document.ready or windows.load ?
link to page
Than...
I want to make the options of < select > show or hide by program(JS),is it possible ?
it just like the interesting tags in the front page of StackOver Flow,when you type in some words,the drop list will expand and give you suggestions.
ps.I know StackOver didn't use select in this case,anyway,just take it as an example.
...
This is the first thing I write in javascript, so I hope its a basic error
What I'm trying to achieve here:
Take a bunch of links from a page, load their contents query for links inside and add them to a list on current page.
I get error on the append
And in JQ documentation they say the method can get a JQ object
<script type="text/j...
Hello,
My search page is search.html and when people open that page by default i want to display result for "myword" how to do that please help me and here the code:
search.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Powered Site Search Demo</title>
<script sr...
Hi all
I'm using jqGrid with jQuery to display some data on an application I'm building and am struggling over extending its abilities.
How would I go about toggling a "fullscreen" mode for the grid. i.e. expanding the grid to the full size of the page, on top of the other elements?
Thanks all, Gausie
...
I'm making a form to order different varieties of sweets from a website. At the moment I have checkboxes with each variety. Once they have chosen the varieties they want (they can have more than one) then I need some more information. To do this I want to display a new box when they check each checkbox. Event attributes seem to be adequa...
Been making this site for the past week. Only just came across this error in IE8.
There's an error in the jquery.corner.js file:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Sat, 25 Sep 2010 16:13:34 UTC
Mess...
I'm using the jQuery audio player 'jPlayer', I have a loop which creates a number of jPlayer unique instances then assigns an on click 'jPlayer play' to another part of the document for each instance.. The problem is jPlayer uses an internal ready: function() {} to assign the audio path and load the file.. I need to wait for this functio...
Hi ,
<html>
<head>
<script type="text/javascript">
function display(id)
{
// open jquery modal window using jquery UI
}
</script>
</head>
<body>
</body>
</html>
I want to open jquery modal window using jquery UI whenever the function display is called using normal javascript function call .
I can use .diolog function of jquery...
A book has several chapters, and each chapter has several sections. This could be deemed as either a two-level tree or a nested list.
Now I need to display the catalogue of the book. And the user can drag-and-drop to re-order chapters and sections. Do you know any good javascript widget for this?
After the re-ordering, the new orde...
$('something').parents('selectors') lets me move several levels up the DOM at once, versus parent() which unsurprisingly returns the current element's immediate parent. Unfortunately (though logically), children() does not operate like parents() and instead only returns the element's immediate children, similar to how parent() works. I'm...
I have read the MSDN blog post about the subject.
And this question doesn't help me much either.
As far as i can tell checking Microsoft.XmlHttp is enough.
Someone could confirm me this bug?
Are there any earlier version of IE which require detecting both?
...