I am using the code below to replace text inside a div. But I need to loop through a specific div, instead of everything on the page, that is the div's text nodes...
I just do not understand how to refer to the div in the code below.
(function (parent) {
var childs = parent.childNodes;
// if there are children to this
if (childs &...
What is an easy way to remove the querystring from a Path in Javascript?
I have seen a plugin for Jquery that uses window.location.search. I can not do that: The URL in my case is a variable that is set from AJAX.
var testURL = '/Products/List?SortDirection=dsc&Sort=price&Page=3&Page2=3&SortOrder=dsc'
...
I have a situation where I need to bind a click event to an object multiple times.
For instance:
for(i=0;i<=100;i++){
$myObject.click(function(){
window.location = "myurl"+i+".html";
})
...do other stuff...
}
Via that markup, does $myObject end up with 100 click events attached to it? Should I be unbinding the cl...
I'm using Jeditable for in-place editing. One the controls I am working with has the select type. When a user clicks on the field, the following select control is generated:
<div id="status" class="editable_select">
<form>
<select name="value">
<option value="Active">Active</option>
<option value="Ina...
The following code gets a JSON object and then spits its contents out into a <table>. The first time I do it I get my JSON content just fine. However, when I refresh, the refreshed data is stuck onto the bottom of my table. How do I refresh the data to show the new data only? I tried using .remove() but there was an obvious deleting ...
Hello,
So I have the following:
var box = $(".MyCheckBox");
if (box[0].checked)
{
// Do something
}
else
{
// Do something else
}
Is there a better way of doing this using filters or something?
I know I can go:
$(".MyCheckBox")
.filter(function(index) {
return this.checked;
})
.each(function() {
...
Hi,
I want to call a callback method that may or may not be implemented in pages being loaded as Ajax content by jQuery tabs. In other words, I have a set of jQuery tabs that load content rendered in JSP files. Some of these files have additional Ajax content in them, some don't.
What I could do is:
$(document).ready(function() {
...
I'm appending some code to my page using jQuery AJAX calls. This code is a mix of html and javascript. But I want javascript to be executed only when html part is ready. But what event is raised when appended html is rendered?
Here is an example:
<table id="sampleTable">
...
</table>
<script>
// this code should be executed only ...
Can anyone explain why the following jquery only fires the 2nd toggle event and how to fix it? Specifically, every time I click the nested < a > element it brings up the alert "2nd click".
I tested the selector to make sure it was selecting the element properly and it does, or at least it inserted a class without any problems.
The sel...
i'm trying to use jquery to implement a portlet/widget style interface, with 3 columns and drag and drop within and between them. it's working almost completely, except for issue that it doesn't work in IE6
(function($) {
$.fn.portlet = function() {
return this.each(function() {
$(this).sortable({
connectWith: ['.por...
Based on my previous question here and here, I found that I can set a cookie with javascript. I want to combine it with jquery to have a cookie state set for toggled table rows. I want to keep the hidden rows hidden upon reload.
Here is what I have achieved so far:
// Load cookies if any
if(readCookie('togState')) {
$('table#...
I wanted to assign a returned value (just text) to a variable in jQuery. I wrote this:
var hm=22;
$.ajax({
type: "GET",
url: "ajax_check_match.php",
dataType: "text",
success:callback
});
function callback(data, status)
{
//...
Hello,
This is the final output
My HTML
<li id='$id'>TEXT
<ul class='indent'>
<li id='$id'>TEXT</li>
<li id='$id'>TEXT</li>
<li class='formContainer'> FORM </li>
</ul>
</li>
I want to append a li between form after all other li So in this example new li will be appended between Test141 APPEND Input B...
Hello there,
I have no idea how to do this.
My markup:
<table>
<tr>
<td id="colLeft">
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor.
</td>
<td id="co...
The following bit of code breaks in the upgrade to jquery 1.4:
$().mousemove(
function (e) {
defaults.mouseX = e.pageX;
defaults.mouseY = e.pageY;
});
};
What appeared to be a reasonable fix was adding "html" as the selector, ex: $("html").
The fix works fine - except now when the user mouses off the page, it doesn't ...
I have a very simple test page that uses XHR requests with jQuery's $.getJSON and $.ajax methods. The same page works in some situations and not in others. Specificially, it doesn't work in Chrome on Ubuntu.
I'm testing on Ubuntu 9.10 with Chrome 5.0.342.7 beta and Mac OSX 10.6.2 with Chrome 5.0.307.9 beta.
It works correctly when fi...
What is the syntax for passing the form scope into a cfc with access="remote"?
I have:
<cfcomponent>
<cfset Variables.Datasource = "xxx">
<cffunction name="Save" access="remote">
<cfset var local = {}>
<!--- todo: try/catch --->
<cfif arguments.PersonID>
<cfquery datasource="#Variables.Datasource#">
UPDAT...
Hi,
I am having problem getting my tooltip to work when using the jQuery load() function. The tooltip works fine if i don't use load() to load external dynamic data.
I googled and found the i may need to use live(), but I can't figure how to get it to work. Any suggestion?
thank you!!
Here is my scripts:
function loadEMERContent(ui...
I am using ASP.Net and jQuery/jQuery UI and I am trying to use the datepicker control. It works fine on every page, except when I have to use the popup (to add new data into the database and then i refresh the current page to reflect the new data being entered). It seems that document.ready() is failing when I use the popup. I can invoke...
...at least to me. This code used to work fine. I'm pretty sure nothing has changed, but now all of the sudden it behaves oddly. Basically I'm trying to create inline editing functionality. When the user clicks on the link, it dynamically generates a textbox and a confirm and cancel link. I'm having problems with the cancel link not remo...