I was trying to sort some xml with jquery, but this code doesn't affect the actual xml or not returning a sorted result.
Anything wrong with this code?
$(xml).find('Tag').get().sort(function(a, b) {
return $(a).find('Name').text() < $(b).find('Name').text() ? -1 : 1;
});
...
Hi,
I have a web page that contains two lists (Unorders lists), I have to move items from list 1 to list 2 but to filter out items that are already in list 2.
I'm using JQuery as js library. I know I can select all items to be moved to list 2, loop one by one and check if alredy exists in list 2, but was wandering if there is a way to do...
Hi all,
This problem surprises me because it does not work in Chrome as well. Chrome!!
Anyways, I have 3 select boxes, A, B, C. On a page load, B and C are hidden. (This is fine in all browsers). Currently, I have an event handler attached to specific values in box A, so that if a value is clicked, B shows itself populated with res...
Hi everybody,
I am fairly new to javascript and DOM and I am having a problem with manipulating DOM using javascript for the following html code.
<html>
<head>
<title>Testing</title>
</head>
<body>
<marquee direction=up height=400 scrollAmount=3.7 scrollDelay=70 onmousedown="this.stop()" onmouseover="this.stop()" onmousemove...
Hi,
I want to allow user to select range of items in my unordered list by allowing him to press cntrl key and then select first & last item, all items in between would be selected.
I'm using JQuery, Any suggestion how to approach this problem?
Here is html:
<ul id="ulList_1">
<li>
<a href="#">item 1</a>
</li>
<l...
Im not proficient in JS myself very much, so it would probably take me a few hours to figure this out myself, so I figured I'd ask you guys.
I have Delete/Ban links on my site, that are used by admins to moderate the users and what they post. Since these links have such drastic consequences on the site's content I would want to have so...
I am trying to figure out how to display if an item is in stock or not using the javascript ebay API. This would be for items that are for sale at a fixed price with BuyItNow.
I am just starting to work with Ebay, and really don't know why their systems work. It is quite possible that once an item is out of stock, it is no longer list...
How do you determine the difference between new Object and new fn under these conditions?
var fn = function(){};
fn.prototype = {};
You may not rely on __proto__ or Object.getPrototypeOf existing, as they are not in IE or Opera.
The solution may not statically use fn, such as instanceof fn.
Implementing your own Object.getPrototypeOf i...
CSS doesn't support arithmetic such as margin-left: -60px + 50% of the width of the parent div. But my desire to do so is overwhelming. Does anyone know a solution using JavaScript or otherwise?
ThanksMike
...
Most date pickers allow you to pick the date from a tine calendar or enter the date by hand.
For example http://jqueryui.com/demos/datepicker/
This requires
- two clicks (one to display the calendar and one to select the correct date)
- good eyesight (usually the pop-up calendar is very small)
- and good hand-eye coordination to pick t...
Hi,
every jQuery plugin I've found is based on <li> elements to generate the menu items.
I have <div id = "menubutton"> element that represents the menu button and another, not-related (maning it is not a child) <div id = "menucontent"> that contains the menu items (mixed stuff, images etc). I want this second, hidden div to appear when...
Im Looking for a simple solution to stop a login form from submitting with empty input fields. The code for the form is below. I would like to use a simple Javascript soluiton if possible.
<form id="login" method="post" action="">
<input type="text" name="email" id="email" />
<input type="password" name="pwd" id="pwd" />
...
Hi everyone, I have an array with objects, I want to save each one of them via GET, and update certain params in the callback, bot
the html:
<html><body><div id='test'><div id="a">a</div><div id="b">b</div></div></body></html>
the js:
$.map($("#test > div"), save)
save = function(o,i){
itt = $(o)
tmp = {'desc':itt.html()};
$.ge...
I am new to JSON and trying to recover some text from a JSON variable.
The JSON variable is sent from a Javascript File and has this structure:
foo({
"query": {
"count": "2",
"created": "2009-07-25T08:17:54Z",
"lang": "en-US",
},
"results": {
"result": [
{
"abstract": "<b>Pizza</b> Hut®. Order Online for Deliver...
Using the demo for JQuery Validation at:
http://jquery.bassistance.de/validate/demo/milk/
The username field does a lookup to a php file to see if the username is available or taken. In the demo both George and Peter are taken.
When you type in George, you get the error message:
"George is already in use"
....now if you go back and...
I'm trying to execute an external function on click of a DOM element without wrapping it in another function.
Say I have a function called sayHello(), as follows:
function sayHello(){
alert("hello");
};
To execute it on click, I currently have to do this:
$("#myelement").click(function(){
sayHello();
});
Notice I am forced to ...
How can I get form inputs real time and use them to change the background color of elements?
I have an input field that will accept six digit hex values:
<input name="acct-bcolor" id="acct-bcolor" class="color" value="141414">
Thanks in advance.
-B
...
Hi,
i am receiving a piece of plain html from an ajax request.
<h1>Title</h1>
<div>
content
</div>
This is the most simple form. Every piece contains a <h1> tag for a title, and a <div> tag containing the content. I have a nicely formatted container in the html page which needs to populate with the returned html snippet.
This is t...
I have a bunch of checkboxes that are created dynamically on page load and written like so:
<input type='checkbox' name='quicklinkscb' id='quicklinkscb_XX'/>
where XX represents the id of the item from the database.
I want to be able to parse the page via javascript for all checkboxes and:
find their id and strip the 'quicklinksscb_...
Say I've got a big list of elements which are displayed vertically.
How can you change the window position so that a specified element in the list is shown at the top of the page with javascript?
Does this method work for major browsers (ie 6+, firefox, safari, chrome)?
Thanks
...