I have a JavaScript object with some properties. Lets say:
var haystack = {
foo: {value: "fooooo"},
bar: {value: "baaaaa"}
};
Now, I want to access one of those properties, but I don't know which one. Luckily, this variable does:
var needle = "foo";
In modern browsers I seem to be able to do the following and it works:
haystac...
Hello, I am using this pagination class and was looking for a way to make the sql query more dynamic instead of having it hardcoded.
I have a 3 <li> elements that I want to be filter buttons, meaning when a user clicks on one of these elements I want It to send the id so I can use it in a sql query.
So for the $sql = "select * from ex...
$("#epFilter").keypress(function(){
query = $("#epFilter").val();
alert(query);
});
In this code, whenever I type in my text box, it always alert one character less. It doesn't catch the last character. Why?
...
Hello,
I have html like so:
<div class=foo>
(<a href=forum.example.com>forum</a>)
<p>
Some html here....
</div>
And I want to insert another link after the first one, like so:
<div class=foo>
(<a href=forum.example.com>forum</a>) <a href=blog.example.com>blog</a>
<p>
Some html here....
</div>
...but because it is enclo...
I am very new to JavaScript and only have the most basic understanding of how it works, so please bear with me. :) I'm using the jquery.innerfade.js script to create a slideshow with fade transitions for a website I'm developing, and I have added navigation buttons (which are set as background-images) that navigate between the “slides”. ...
I want to hide all the descendents of the "ul" for my tree menu when the page loads up, then as each "main" "li" link is clicked display the direct child, and if the direct child has children (grandchild), when the the "Child" is clicked I want it to show the "grandchild" elements. should be simple, but some how I screwed things up and w...
Greetings Guru's, This is a little hard to explain, but I'll give it a shot.
I have a quick question regarding to the .live() function in JQuery. I'm going to simplify the example here. I have a page "index.php" that has a container "#display_files_container" which is populated with anchor links that are generated dynamically by a di...
I have a page that has a tab set. Each of the tabs is loaded by the jQuery .load() function.
I want to display a loading animation that disappears when all of the ajax requests are finished. However, document.ready() has only provided me with limited success.
How can I ensure that all ajax requests are completed before executing the ...
I have a string which is basically a list of "words" delimited by commas. These "words" can be pretty much any character e.g. "Bart Simpson, Ex-girlfriend, dude, radical"
I'm trying to use javascript, jQuery, whatever i can to replace a word based on a search string with nothing (in essence, removing the word from the list).
For exampl...
I'm making the script for easy upload many files. I've tried fyneworks plugin, but the file name does not appear in a form that uses tiny_mce. This is the code:
$("document").ready(function () {
var i = 0; //iteration for Inputted File
var max = 5; //max file uploaded
createStatus(); //generate status container
$('.image...
I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/
It authenticates against w/ our ldap server.
What I am having a problem with is the line
success: function(){
$('form#submit').hide(function(){$('div.success').fadeIn();});
It runs success even though we don't even kno...
I'm writing a jQuery application to allow analysis of data with the help of visual cues. My data is retrieved via XMLHttpRequest in the form of JSON. The visual cues include histograms, spark lines, and various other graph types. The idea is that the user is able to narrow their data via these various visual views.
My question is thu...
So this function works fine in geko and webkit browsers, but not IE7. I've busted my brain trying to spot the issue. Anything stick out for you?
Basic premise is you pass in a data object (in this case a response from jQuery's $.getJSON) we check for a response code, set the notification's class, append a layer and show it to the user. ...
I'm trying to convert the John Resig's Templating Engine to work with PHP.
Essentially what I would like to achieve is the ability to use certain Kohana Views via a JavaScript templating engine, that way I can use the same views for both a standard PHP request and a jQuery AJAX request.
I'm starting with the basics and would like to be...
Hi,
I'm trying to extend jWysiwyg with an function to add a map from Google Maps. I can get the map all right, but I'm having problems with how to handle the generated map so it can be saved with the page and then retrieved.
To open the process up a bit:
User enters editor which is created using jWysiwyg.
User clicks on a button whic...
Hi! I'm developing an asp.net application and need to bind view data to model using jQuery.
I have two UnorderedLists's and using drag&drop between them with jQuery's sortable(), ulSource and ulDestination. In code behind, there are two model class as Destination and Source.
using standart asp.net binding its sth like that:
<asp:Bulle...
Hi
I have some code which builds an array of date ranges. I then call a function (from the jquery UI datepicker), passing it a date, and compare that date with dates in the array. I'm doing it this way because the dates are stored in a cms and this is the only way I can output them.
Unfortunately my code only checks the first date ran...
Is there a way that I could trigger an onresize() event for my window in javascript/jQuery?
I tried:
$(window).resize();
but that didn't seem to work exactly as expected. The simplemodal jQuery plugin gives you the option to autoPosition your modal window. Sometimes in IE, the modal shows up a little off center but as soon as I manua...
I have LI that I want to fade out and back in. Within the list item I have some text. This text is positioned absolutely within the LI.
The catch is that in IE8 (IE6 and 7 seem fine) I can get everything to fade except the text:
http://jsbin.com/esamu/13
If I remove the absolute positioning on the text element (in this case, a P), IE8...
I'm running jquery from a file. And I'm trying to load a svg file from my localhost to populate a svg canvas. However that does not work as expected.
What I do from filesystem:
$.ajax({ url: url ,
timeout: 1000,
complete: function(xml) {
alert('complete');
},
success: function(xml, status, xreq) {
alert('...