I'm sending some html via jQuery, and in this html are various values that need to be quoted, and in one instance, there's a nested value, so I have to be able to send both kinds of quotes. Here's some mock code:
var myVar = "<tag value='foo' value2="config={'bar':null, 'foo2':true}" />";
How can in ensure that the double quotes are s...
Hi All,
I would like to know if anyone out there has had experience with any simple lightweight jQuery galleries.
My requirements for this particular project are quite simple, and I have made a genuine attempt to roll my own code, however this is just a bit puzzling for a beginner.
I have a large div that loads with an initial image.
...
I have a function like this
function saveProfile(data, url, successFn) {
$.ajax({
dataType: 'json',
data: data,
url: url,
type: 'post',
success: function () {
successFn();
}
});
}
is there any difference to passing the successFn directly like this...
function saveP...
Just out of curiosity, I am trying to see if it is possible to use jQuery to read a HTML file so that I can use it to output some values of some html elements? I am looking for some functionality like what Firebug provides i.e. Firebug lets me use the $() on any webpage so what I am trying to achieve is:
I have a bunch of HTML files
I ...
Which code will work fastest?
for(i=0; i<100; i++) {
jQuery("#myDiv").append("<span>" + i + "</span>");
}
//
var i, markup = "";
for (i=0; i<100; i++) {
markup += "<span>" + i + "</span>";
}
//
jQuery("#myDiv").append(markup);
//
var i, markup = "";
for (i=0; i<100; i++) {
markup += "<span>" + i + "</span>";
}
//
jQuery(...
Happy Halloween everyone, hope it was a fun night!
I've just implemented an AJAX search functionality on my first ever ASP.NET MVC project, and I just want to get your feedback on security and performance.
The project is going to be a simple Forum, with roughly 40 topics and 1000-3000 total posts.
Let me show you some code.
In my Top...
I know there are a lot of questions similar to this one already out there but none of them seemed to be the same as my current issue (if so sorry for the repeat).
What I am trying to create here is a script that will; upon clicking of a link, take the link name and type and find it in the folder. Then once it has been located add it int...
Hey All, thanks for the help in advance. I'm trying to create and remove input fields dynamically, they create just fine, but when i try to remove them it doesn't seem to find the div thats created, and removes the div above it, and hence all the inputs, instead of the just the one.
Heres my jscript:
$("#addp").live('click' ,(function(...
If you click the body of the html once and wait until the ball is offscreen its fine. However if you clicked 2+ times you'll notice the ball moving faster. When you click the body again to make the ball come back it is still faster then it should be. Why? http://jsfiddle.net/44nwt/10/
-edit- in firefox on my page (i havent tried on jsfi...
Possible Duplicate:
Retrieve a cross domain RSS(xml) through Javascript
Hey,
I'm creating a website and I need to display a couple RSS feeds. I noticed XMLHttpRequest() doesn't support cross-domain requests. How can I do it with Javascript or jQuery?
Thanks!
...
Thanks to StackOverflow, I managed to get the following code working perfectly, but I have a follow up question.
$.get('http://example.com/page/2/', function(data){
$(data).find('#reviews .card').appendTo('#reviews');
});
This code above enabled my site to fetch a second page of articles with a Load More button in WordPress. Howeve...
So I have this script on a website i'm working on, which basically loads images from a database and puts them in a div. When all the images are loaded, I want it to fire a scroller plugin (smoothdivscroll). But I can't find a way to make the last part work.
Here is the code:
$.get("pages/photosgigs.php", { gig: $(this).attr("id")}, fun...
Hey!
I have this code for the form:
<form class="myform" name="myform" method="POST" action="post.php">
<textarea id="mytextarea" name="mytextarea"></textarea>
<button>Share</button>
</form>
I also have this code for the page:
<div class="content">
<div class="message">That message</div>
<div class="info">Published 10/10/10 </div...
I can't seem to make the "tohide" element hide and thus toggling doesn't work either. Dreamweaver tells me that my error is this line }); which appears under the line $("#mydiv").toggle();
<html>
<title>Hider</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"/>
<script type...
Hello,
I have this script provided by @Felix Kling in this post HERE, but is crashing my IE when I use it; on FF 3.6, Opera, Chrome, Safari work fine.
Any idea why is this happening? A fix maybe?
var ajaxTimeout;
function autorun() {
if ($("#contactForm").is(":visible")){
if(ajaxTimeout) {
clearInterval(ajaxTi...
Suppose all forms in your application has this structure:
<div id="result_messages"></div>
<form action="/action">
<!-- all the form -->
</form>
A submit button for this form looks like this:
<input type="button" onclick="$.post( '/action', $(form).serialize(), function (data) {
$('#result_messages').html( data ); // At this ...
Hi,
when loading content via ajax requests,
If the response is:
<div id="container">
<a href="http://www.google.com">To Google</a>
<a href="http://www.yahoo.com">To Yahoo</a>
<a href="http://www.digg.com">To Digg</a>
</div>
With the jquery loaded, and after content loading, i call a function that do the following...
I'm trying to learn how to use jQuery FlexBox. Getting confused:
My understanding is that as the user is typing into the FlexBox, what he types will be sent to the server through ajax. I'm using Django on the server side to do autocomplete, but how do I actually retrieve what the user has typed? Is the query being sent as a parameter? ...
I have an issue with my WYSIWYG editor. If users copy in outside text, this is seen as something like the following:
" p.p1 {margin: 0.0px 0.0px 0.0px
0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px} p.p2 {margin:
0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'} Only the variables
assigned in the last loop are
a...
OK, i have this jQuery script using ajax to load a response from a php file, but i want to do is to load maybe two variables from the php script rather than the whole page.
$(document).ready(function() {
$.ajaxSetup({
cache: false
});
$("#object_area").load("test.php");
var refreshId = setInterval(function() {
$("#object_...