I have an anchor link which links to another page. When it is clicked, by default it goes to the top of the next page. I want it brought to a certain position of the page. How do I do this (either with a jQuery slide effect or normal html)?
For instance, when .sample a is clicked I want it to bring you to a certain position of the linki...
my php code will check after a condition. if the condition is true i want it to trigger a jquery code that displays a box.
i wonder how i can trigger a jquery code with php?
...
I have a bookmarklet that when clicked opens up a div popup on their current page(e.g. www.cnn.com). This div has a button that that when clicked makes a jQuery.get request to my application domain. This is all working fine, but I am getting an error on the response. This is the function that makes the request
function postWishXML(){
...
i use $.get to run php file. how can i send key-value pair (eg. variables) from the php-file to jquery? and when sent, how can i retrieve them with jquery? i want to validate eg. if(key == value) in jquery.
and what is the difference between $.getJSON and $.get? if i want to run php i cannot use $.getJSON?
i tried in the php file use:
...
How to calculate shopping days till christmas counter in jQuery. need to add to website.
need quick and dirty. no partiaulcar date it needs to correspond to
needs to ignore weekends of course - or maybe not since its for a website. hmm
cant believe there isnt one on here already.
happy holidays everyone!
...
I saw this code snippet:
$("ul li").text().search(new RegExp("sometext", "i"));
and wanted to know if this can be extended to any string?
I want to accomplish the following, but it dosen't work:
$("li").attr("title").search(new RegExp("sometext", "i"));
Also, anyone have a link to the jQuery documentation for this function? I fail...
I have a form that I would like all fields to be filled in. If a field is clicked into and then not filled out, I would like to display a red background.
Here is my code:
*$('#apply-form input').blur(function()
{
if($('input:text').is(":empty"))
{
$(this).parents('p').addClass('warning');
}
});*
It app...
i dont understand one thing.
if i want to get JSON data (key-value-pairs) from php to jquery using ajax...which of these following ones should i use?
$.get
$.post
$.getJSON
do i need to use getJSON if i want to use json_encode in php file? but what if i want to send with post? (there is no postJSON)?
and one more thing:
in php fil...
When we change the name="quantity" and the $product['price'] value will changing too. Here will have dynamic quantity and price. How to do that using jquery/javascript.
<?php
$select = "SELECT * FROM `products` ORDER BY `id` DESC LIMIT 10";
$query = mysql_query($select) or die(mysql_error());
?>
<ul>
<?php while($product = mysql_...
i use $.getJSON to call php file. it echos this back.
for($i=0; $i<=10; $i++)
{
$nr[] = $i;
}
echo "{'result': 'error', 'count': '$nr'}";
in jquery to get result i just use
alert(data.result)
how do i get all the nr:s in count?
EDIT: But how do i loop the array through in jquery? All the keys are numeric and i dont know how to...
i use $.getJSON and here is my php file echo:ing back jsonstring
for($i=1; $i<=10; $i++)
{
$nr[] = "nr" . $i;
}
$nr = json_encode($nr);
echo "{'result': 'error', 'count': '$nr'}";
how do i loop all the nr through with jquery html()?
i want to echo it back to webpage like:
nr 1
nr 2
nr 3
nr 4
nr 5
nr 6
nr 7
nr 8
nr 9
nr 10
...
Hello,
What is better from performance wise document.getElementById('elementId') or $('#elementId') ?
How can I calculate the speed by myself?
Thank you and Kind Regards.
...
this is a little bit tricky.
usually when someone clicks on a link that requires him to register, this person will be redirected to the registration page and then back to the last visited page. this is possible cause the link sent a GET key through the url to the registration.php which uses the key to go back to last visited page.
but ...
Hello, does anybody knows how to check if an image loads properly. I have a script that preloads images and what I wanted to do is if the image doesn't exists, which causes my script not to end, I would just make the attribute "src" to be a default value
image.load(function(){
//it never reache here if the image doesn't exist
}).attr('...
Hello,
In my code i need to poll a url after every 5 seconds using ajax . The URL returns a json response. Below is the code that i wrote inside $(document).ready to do this. But,the setTimeout() function does not work. The startPoll() function is called immediately after the response is received.I want to halt for 5 seconds after respo...
Why this code:
row.append($("<td></td>").text("someText"));
...isn't working, and how can I fix it?
Thanks.
...
hi,
i wrote a little jQuery button plugin - it contains a method for applying the onclick-function - here's the code
(function ($) {
$.fn.tButton = function ()
{
this.setFN = function(fn)
{
alert("function set.");
}
};
})(jQuery);
i'm using this code to initialize it (on a div):
var button = $("#myButton")....
The objective is to have a form reflect user's defined constraints on a search.
At first, I relied entirely upon server-side scripting to achieve this; recently I tried to shift the functionality to JavaScript.
On the server side, the search parameters are stored in a ColdFusion struct which makes it particularly convenient to have t...
Debugging assistance requested.
The page http://www.freshfaves.com/newfave.html contains this code:
<script>
document.domain = 'freshfaves.com';
$(document).ready(function() {
var dbUrl = 'http://freshfaves.com/';
var result = '';
$.ajax({
type: "POST",
url: dbUrl,
data: [], //params,
...
this question is similar to my previous hover question (http://stackoverflow.com/questions/1851141/converting-css-hover-to-jquery-hover) but the answer will be different because it involves a click function and two bgs.
I am building a contact page, and when the user clicks on one of the input fields, I want the background of the input ...