JQuery :: .data() To Accept A Map Of Data?
Oct 6, 2011
Are there any plans to allow the .data() method to accept a map of key/value pairs of data?I don't think this is currently supported although many other jQuery methods support this type of functionality...
$('#myDiv').data({foo: true, bar: false});
View 10 Replies
ADVERTISEMENT
Dec 8, 2011
I want textbox1 to accept only numeric data as 55,65,698.00 Is there any easy way to validate textbox1 with javascript?
View 3 Replies
View Related
Jun 27, 2011
I am using .ajax() to access cross-domain data using JSONP. Because I need to be able to cache the data I want to use a static name for thejsonpCallback function, so I have set the jsonpCallback option in the .ajax() request. However that appears to requires a global function whereas the auto generated function didn't (well maybe it did but that was all hidden from me).
I definitely need to be able to cache the results. Ideally I wouldn't have a global function handling the data. Is there another way to do this? If not what is the best practice way to go about using a global function these days and how do I provide it with the context of the object/module it was called from - which is where the data is needed?
View 2 Replies
View Related
Oct 5, 2011
Relatively new to jQuery but have a problem with getting data to display.Using a webform with 2 forms. User slects and inputs data into the first form, clicks a button then using jQuery .ajax submits the serialized data to a php script. The script processes the input into multiple paragraphs of text which is based on the input from the first form.The data is returned to the webpage and displayed in a text area (of the 2nd form) where the user can edit it to fine tune the wording. The 2 forms are displayed in different tabs so it is easy to move back and forward between the 2 forms.
The problem occurs when the user goes back to the first form and enters or selects different text and then click the submit button to generate a whole new text for insertion into the textarea on the second form. For certain fields the modified text is displayed.However if the whole of the text in the textarea is deleted, then the user clicks the submit button to re-generate the text content area then nothing at all is ever interted into the textarea. If have user alert to check that data is returned from the php handler and this text is correct. BUT when I click on the tab to see the textarea (id is "draftrec") there is no text inserted. The relevant function is below and the line that should insert the text into the textarea is:
$("textarea#draftrec").html(data).show();
//------------------------------------------------------
$("form#form1").submit(function(e){
[code]....
View 1 Replies
View Related
Jan 3, 2011
I would like to use jQuery to prepopulate a form - ie make a call to a php program to get data from a database and pre-populatea form with appropriate data for the user. Can anyone point me in the right direction for some examples on the simplest way to do this?
View 3 Replies
View Related
Aug 21, 2009
I wonder if i can make the variable data which is [data] in jQuery.post( url, [data], [callback], [type] ) dynamic. for instance, this is the form i want to send,
PHP Code:
<form action="send_xml.php" method="post" enctype="multipart/form-data" id="form_send"><input type="checkbox" id="var_1" class="checkbox"/><input type="checkbox" id="var_2" class="checkbox"/></form>
[Code]...
View 2 Replies
View Related
Jul 22, 2011
I am writing a small data entry screen that will post the form data to a page and return a message. But i cannot get the Success or Error functions working properly.
Here's the code where strData is the posted querystring of:
I'm not sure whether it should be in a form and using the onsubmit or click of a button.
View 2 Replies
View Related
Jul 13, 2009
I am still new to jQuery and I am trying to figure something out. I have this code:
[Code]...
This is working fine on itself. What is does is when I click a link it loads data into the following div. When done loading it slides out. But I want to change the appearance of the slide. I have tried to do that like this: $(this).show("slide", { direction: "down" }, 1000); But this doesn't work. When I check firebug it says the following: o.easing[this.options.easing || (o.easing.swing ? "swing" : "linear")] is not a function
View 1 Replies
View Related
Mar 25, 2011
Im trying to convert the contents of a canvas into a data url and then post it along with other inputs to the controller in order to save an image.
The PHP:
<
formmethod
=
"post"accept
[code]...
View 1 Replies
View Related
Oct 26, 2011
I have just started to learn about JQuery and wanted to learn how to retrieve data from an API.
I used the Flickr example provided here [url] and just changed the relevant code to point to the 500px api.
<body>
If I launch the following URL I do get the results properly [url]
Here's a sample of what the result looks like:-
I don't get any results when I run my code page. What am I doing wrong?
View 15 Replies
View Related
Oct 18, 2010
I am trying to try jQuery 1.4.3 updated .data() method with HTML5 data attributes. The way I understood these changes is that an element with these attributes would automatically have their data populated by .data(). For example, if I have an element:
<ahref="#" data-cheese="cheddar">DataElement</a>
I can access this with .data('cheddar'). This part works fine. The issue I am having is that calling JUST data like $(this).data() just produces an empty object. Is this how it should be expected to function?
View 2 Replies
View Related
Mar 31, 2011
i am thinking of using a xml file as a data base for example , the xml file stores a list of reference numbers which is allocated to a url or a name such as 0123456789 and i have a text box on a webpage and the user types in a reference number and the javascripts reads the xml file to check if its a valid reference number i.e a registered number i am new to working with xml etc.
[Code]....
id like it to read the specific data thats contained within the tag such as 0123456789's tag = JOE
View 2 Replies
View Related
Sep 9, 2011
I'm trying to compare incoming JSON data to the existing data to see if there are any changes, but for giant objects like:
Code:
[{"date":"2011-09-03 23:06:03","notifier_id":"1","type":"1","unread":"0"},{"date":"2011-09-05 00:37:46"}]
if (JSON.stringify(oldData) == JSON.stringify(newData))
This doesn't seem to work. I've tried using:
Code:
escape("'" + JSON.stringify(W.notification.list + "'"))
but that ignores the objects properties and returns something like 22%5Bobject%20Object%5D%2C%5Bobject
View 1 Replies
View Related
May 18, 2011
TEST .js
// JavaScript Document
$.post('http://example.com/test.php?image_no='+no_image, function(data) {
$('#gallery').html(data);
[code]....
View 1 Replies
View Related
Dec 5, 2011
i load a iframe in my main page and upload a image in the iframe. Now i need the data from the iframe i a DIV on the main page. I think that go with $('#iframe').contents().find('#msg'); I dont know to write this Data in a DIV on the main page
View 1 Replies
View Related
Jan 24, 2011
I am trying to get data from mysql into a variable, that should be read by protovis.
I tried
/* abfrage_LB.php echoes a json string with the data from mysql */
var parsedData;
$.post('abfrage_LB.php', function(data){
parsedData = JSON.parse(JSONdata);
});
the error message says, that parsedData is undefined. How can I display, what is in parsedData?
View 1 Replies
View Related
Mar 10, 2010
I am new to the while jQuery thing but am trying to run a MySQL query based on trhe selection from a listbox.
[Code]...
The event fires and the alert is shown but there is nothing shown in #details (a div).
I have seen loads of examples if this working so can only assume that I am doing something fundamentally wrong. Edit: I've done a little more testing and it seems to work in IE8 but not in FF3.6.
View 4 Replies
View Related
Jul 22, 2010
this is vexing me no end, because it should be simple as pie…
i can get this to work in opera but in explorer it doesnt.
I have a xml file that I am trying to parse…
<item>
<title>title to get</title>
<description>text to get…</description>
<enclosure url="url to get"></enclosure>
[Code].....
View 12 Replies
View Related
Jul 10, 2011
How do I retrieve info such as thescrollWidth from the DOM? I thought .data would do the trick but it isnt working. This is what I have:
var maxscroll = jQuery.data(this, "scrollWidth");
console.log(maxscroll);
But the console just says undefined (this is in amouseoverevent so "this" should work).
View 5 Replies
View Related
Sep 16, 2010
I need to get some data from the database, then perform actions based on them.
Is it possible in jQuery or is there any way around?
View 2 Replies
View Related
Aug 6, 2011
I am sorry if this has been asked already. I searched but could not find a suitable answer.I am making a simple RSS reader (using jquery mobile) and I need to be able to cache the resulted feed.To understand better let me explain alittle. I have a page where the users selects the desired category. After that he is taken to a different page where the titles of news are. here the feed is read for the first time. When the user click on a title he is taken to another page where I want to display the content of the selected news article.Sincethe feed was already retrieved on the previous page, I want to be able to cache it so that it won't be retrieved again.Any idea how I best do this?
View 4 Replies
View Related
Oct 22, 2010
I need to extract some data from the following block:<span <aref="localhost:80/items/2">item link</a> <span>item attribute</span></span> I can get the item link anditem attributedata by using $("span a") and$("span span"). I, however, can't figure out how to extract the "2" from the "localhost:80/items/2".
View 4 Replies
View Related
Jul 19, 2011
Here is the code I am running:
The url is a very straightforward servlet that queries a database and returns either Y or N. That part is working fine. The first alert shows Y or N just as it is supposed to.
However, the second alert is always showing Turbo, as though the if statement is not able to compare properly. This is probably javascript rather than specific to jQuery, but can anyone see where I'm going wrong?
View 4 Replies
View Related
Oct 3, 2011
i have developed a php based search page, that search from database and it has php based pagination,and from my index page, i am calling that search page using jquery into the resutlist div tag. it all works fine till now,but when i click on next of the pagination link, it took me to the search result page,what i want , is a way that the next href of search page (php pagination) to be called and show its result on the same div tag, without refreshing that page,,
[Cde]....
and on my search page, the next href pass some querystrings like [URL]
now, all i need is that the [URL] this link to be load into that resutlist without redirection or anythign else. remeber, the next link is on the search page, that is called asynchornously using jquery.
View 3 Replies
View Related
Jul 28, 2009
I am trying to make an ajax POST request but its not working. Code below:
var _HOMEDIR = "http://localhost/personal/index.php/home/";
$(document).ready(function() {
$("form").submit(function() {
var str = $("form").serialize();
[Code]....
View 9 Replies
View Related
Jun 23, 2009
I'm having some real difficulty figuring out how to manipulate xml data with jquery. Here is my situation. I have a hidden TextArea that contains xml data, something like this:
<items>
<item value='1' text='x'></item>
<item value='2' text='y'></item>
</items>
So, let's say I want to remove the item with value='1'.
1) I grab the value of the textarea:
var xml = $("#" + id).val();
2) I then find the node and remove it:
$(xml).find("item[value='123']").remove();
Problem is, it doesn't remove anything! It finds the node just fine,but the remove() function doesn't seem like it is doing anything. I've tried looping through eacy item $('item',xml).each(function.... ); and
then calling remove(); but that does not work either.
View 5 Replies
View Related