I followed this thread. I now have:
<a href="#" onclick="$('#gc').load('test');">reload</a>... </span>
<div id="gc">
empty
</div>
This is what I am getting:
Uncaught exception: TypeError: Cannot convert '$('#gc')' to object
Error thrown at line 1, column 0 in <anonymous function>(event):
$('#gc').load('test');
What is that? I thought I would be able to select a div and replace the contents with load()?
I want to convert the below HTML to single tag:
Before :
<div class="Parent1">
<div class="Child1">
<a href="#">Child1</a>
</div>
<div class="Child2">
<a href="#">Child2</a>
</div>
</div>
<div class="Parent2">
<div class="Child1">
<a href="#">Child1</a>
</div>
<div class="Child2">
<a href="#">Child2</a>
</div>
</div>
After :
<div class="Parent1">
<button>Child1</button>
<button>Child2</button>
</div>
<div class="Parent2">
<button>Child1</button>
<button>Child2</button>
</div>
i tried with wrapping/unwrapping. But it does not work. This I want to be generic.
i have a click event for $('#blah div'). div has text inside of it (not inside a div, span, p, etc) and has a textarea in it. The textarea is triggering the event as well, how do i make it only trigger when i click the text and ignore the textarea?
i am will kill my self from 7 days iam tring to find a good slider
but i did not found any thing
i want content slider working in <div> and i can add next and prov buttons in any place in the html
i will kill my self
please help me
Code is here:
http://jsfiddle.net/jf7t2/1/
Please run it on the latest versions of all browsers, and see for yourself. When the button is clicked, on:
on Chrome (and Safari of course) it just doesn't select anything, instead creates some ghostly empty option
on Firefox and Opera, it works the way I expect and want it to work, resets the element value
on Explorer, it does nothing
So, which one is expected behaviour? Thanks.
I have the image at specific position e,g
img {
position:absolute;
top:150px;
}
Is there any to scroll the image with text scrolling so that image always stays at same position with respect to screen.
I don't want to use position fixed
I want to be able to search for a substring inside the href's in the below code and select the link AFTER the selected string. So, for example the string "page=2" would access the third link.
Thanks in advance.
<div id="container">
<a href='test.php?page=1&title=a title'><a title</a>
<a href='test.php?page=2&title=another title'><another title</a>
<a href='test.php?page=3&title=a last title'><a last title</a>
</div>
It's amazing how simple this should be but I can't get it to work. I'm looking to animate a set of divs one at a time. I am using animate.css for those familiar with it. I thought I may have found the answer here but jsFiddle is not working at the moment. Anywho, the code is
$('.elements').each(function(i)
{
$(this).addClass('animated slideInLeft').delay(500);
});
The problem is that when I debug and step through each element, the animation is happening for each element but when I let it run, it appears to all do it at once. What is needed to actually show the animation one at a time?
Thanks
EDIT:
jsFiddle is back up and that link provided below did not help. The answer did not include looping through elements, but looping the animation itself.
EDIT 2
Here is a Fiddle to play with if you guys need one.
Hello,
i have two String fields who represent Date in my page and i would to compare this two fields to know if my first date < second date
<tr>
<td align="right">First Date: </td>
<td align="left"> <html:text name="addPublicationForm" styleId="firstDate" property="firstDate" maxlength="10"/></td>
</tr>
<tr>
<td align="right">Second Date: </td>
<td align="left"> <html:text name="addPublicationForm" styleId="secondDate" property="secondDate" maxlength="10"/></td>
Here is html:
<a href="http://site.com/any/different/folders/picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/some_other_name.png">Go and win</a>
How to add some text after last "/" in href attribute (before picture_name.jpg) of each link?
The script should give something like:
<a href="http://site.com/any/different/folders/user_picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/user_some_other_name.png">Go and win</a>
Here user_ is added.
There can be any length of the link.
the thing is that there are number of items in the html select list,what i want to do is to click on any of the item, then query the database on the id of that item. retrieve the value and then display that in the textbox, how would i query the database?
I would really appreciate that if someone provides the code sample for querying the database
Hi guys i am trying to modify this code here.
$(document).ready(function() {
var randomImages = ['img-1','img-2','img-3','img-4'];
var rndNum = Math.floor(Math.random() * randomImages.length);
$("div#bg-image").css({ background: "url(http://example.com/images/" + randomImages[rndNum] + ".jpg) no-repeat" });
});
This works fine and gives me a random image each time which is great but what i need is for the image to increment +1 each time on page refresh.
This is because sometimes i can refresh 3 times and will still get the same image show when using Math.random(). I need to cancel the random and set +1 each time.
Any help
$('tr').click(function() {
$("#showgrid").load('/Products/List/Items/');
});
Using this.I am handling click event on the row of the table..
but my quetions is how Can i handle only on the first column?
that is giving click action to only first column not on entire row?
can anyboyd help me out
thanks
Is there a way to access the super object when extending objects using $.extend?
I would like to extend an object, override a method, but call the overridden superclass method in the subclass method.
I came across a case where I have to convert html table data into json. In this process I have to iterate through table and convert one by one(row) into array and then convert the whole array into json? Need help in iterating through table(each ow and column)?
I have a table where every row has a unique id.
The last table cell has class="status" where I want to show the user the result of their action.
In my $.ajax call, I have:
,success: function(result){
$('tr#'+result).td('.status').text('Updated');
};
result is the id of the row that was updated.
It's just throwing an error message that says $( and that's all.
I have a button ("login_button"). Every time I click the button I want a DIV ("login_cont") to appear. And after, if I click anywhere else on the page I want this DIV disappear again.
This is my code
$(document).ready(function(){
$('#login_button').click(function(e){
$('#login_cont').fadeIn();
});
$(document).click(function(e){
$('#login_cont').fadeOut();
});
});
This looks good to me (I'm new at this).
But. Every time I click on the button, the div appears but then also disappears in less than a second... why and how can I fix it?
I am trying to make a Login popup window. For example, if someone clicked the login button a popup window will show and it will change the opacity of the main page and give focus to the popup window. Here is an example of a web site that utilizes what I want to implement.
Here
As part of a jquery function u use this ajax post statement to get some reaction from a server.
I want to pass some arguments to my test page. But these must be variables and are declared on the previous lines (iid and inst)
How can i put these variables within the data object marked with the XX?
iid = $(this).attr('iid');
inst = $(this).attr('inst');
$.post("test.php", { inst: XX, iid: XX},function(data){
alert("Data Loaded: " + data);
});
Hello
can some one help me with code to get element by classname and also change the name
currently ive tried
$('selected').attr("name", 'blah blah');
and also
$('.selected').attr("name", 'blah blah');
noneof these work
thanks