Hi,
I need to obtain postdata from a form and send it
via ajax .
The code is given below :
var $fields = $('#myform :input').serializeArray();
var values = {}
jQuery.each($fields, function(i, field)
{
values[field.name] = field.value
});
myJson = JSON.stringify(values);
Now, instead of values[fiel...
Hello, how can I check whether the cursor is over some div at the html page with JQuery/Javascript?
I'm trying to get cursor coordinates and look if they are in the rectangle of my element. Maybe there are predefined methods?
UPD, don't say anything about hover events, etc. I need some method which will return true/false for some eleme...
Hi all,
I am encountering a problem using CFGRID with JQuery. Here are the sample codes using the CFARTGALLERY database:
gridtest.cfm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<cfajaximport tags="cf...
Hi all,
my problem is very simple: I want to know how many characters are inside a 'p' tag and if the number is over 100 fire an event on hover.
I tried to retrieve the char number like this:
var charLength = $('.myPar').val().length;
<p class="myPar">this is the content of the paragraph</p>
it returns always zero as value and it seem...
I have a couple of functions bound to the click event for a link.
//submit forms when links are clicked
$("a.submit").click(function(e){
e.preventDefault();
$("form").submit();
});
and:
//turn this off in webkit for now
//if (!$.browser.webkit){
$("a.btn").click(function(e){
//if this is a submit or a save button
...
If for example, I have some jQuery doing something simple like:
$("div").fadeIn('fast');
$("div").html('Foo');
That would fade in the div, and set its html to "Foo" whilst it's still fading in, whereas:
$("div").fadeIn('fast',function(){
$("div").html('Foo');
});
Will only set the html to "Foo" after the div has completed fading...
I read about the function in the jQuery api ,but I didn't understand it.
Can you explain it?
...
I'm in the process of tweaking a web application and so far I've had some really helpful guys from here, explaining things in layman's terms. Thank you.
One of the abilities I wanted in my app was the ability to search through records and use the result to generate different kinds of useful reports. In my workplace we use a system like ...
Hi,
i tried different methods to insert a text into an iframe.
My iframe runs in "designMode='on'". Which makes it possible to be editable.
I use the jquery.fieldselection plugin to get the current selection which i had to fix to be able to read from iframes.
The problem is now i want to add a simple plain text in the ifram at the curr...
I have a simple drop down box on a page with the below code:
<p>
<%= f.label "Group" %><br />
<%= select("employee", "group_id", Group.all.collect {|p| [ p.name, p.id ] }, { :include_blank => true })%>
</p>
<div id="employees">
<!--this will be filled with ajax request-->
</div>
it shows Groups to the user. Wha...
Hi All,
I'm just starting out with JQuery.
My Question:
I want to know if I can modify this code below to shorten long URLs, but ignore anything that isn't a URL?
My Problem:
This code fragment targets everything in the DIV ('tasks-overflow'). Although I just need it to affect URL's in that DIV based on protocol(http://...). There ar...
I've written a jQuery function to check the total number of characters in a given textbox and pop up a warning if it exceeds the maximum (user-defined) length.
Example: (greatly simplified):
function checkLength(txt)
{
if (txt.length >= maxlength)
{
alert('Too much text entered');
return false;
}
else
ret...
I'm using this to open outgoing links in a new window, but when the target
is an image, I want to display the image alt as the title.
$("a[href*='http://']:not([href*='"+location.hostname+"']),
[href*='https://']:not([href*='"+location.hostname+"'])")
.addClass("external")
.attr("target","_blank")
...
I updates a div content with some html via an ajax call, and I what to execute a function after all the images from the ajax response are loaded.
See the code below, #gridWrapper is coming from the Ajax response and it has a lot of thumbnail images.
success: function(Data){
MyGrid.prepGridLayout(Data.html);
$('#gridWrapper .thumbnai...
Many articles (e.g. msdn) have told be that a circular reference can not be cleaned up in some browsers when it involves a DOM object and a JS object.
(IE 6 can't do it at all and IE7 can only do it between page requests):
Javascript Native (Leaks):
function leak(){
var elem = document.createElement("DIV");
document.body.appen...
I want to mess with jQuery and Ajax for a little while.
For my first I want to create just a single input box, type in my comment and then the comment will appear below. No page refreshes. How can I do this?
...
Hi there,
I have a custom plugin, with a constructor like this:
(function($){
$.fn.extend({
myplugin: function(options) {
[..]
In the plugin, I have a bunch of other functions. Now I attach my plugin to a dom-element:
$('myelement').myplugin()
and after that I want to send a message to the plugin from the wrappin...
Hello,
I have added jQuery tabs to my upcomming site. So far no problem.
But I want - when clicking on a tab - that it should do and behave as a regular link.
Exampel 1: Look at this link http://jqueryui.com/demos/tabs/default.html. When clicking on the options:
Nunc tincidunt
Proin dolor
Aenean lacinia
It loads the content from ...
Is there a JS/jQuery widget that would allow me to display a simple legend that contains for example a small colored rectanlge and a text label next to it?
In this specific case the legend would show meanings behind different color codes in an inline jQuery UI datepicker widget, which would be customized to enable multiple selections by...
is it possible to read or extract html/text from a different .html page using jquery?
this what i would like to read and display in a different page
<div class="newsItemContent">
<h1 class="title">
heading 1
</h1>
content 1 c...