Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
JQuery JQueryMobile
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===API=== The '''$''' sign is special and important character. $() is used for element selection like: $(this).hide() - hides the current element. $("p").hide() - hides all p elements. $(".test").hide() - hides all elements with class="test", class names are prefixed with '''.''' $("#test").hide() - hides the element with id="test", id names are prefixed with '''#''' $("p:first") - selects the first p element *getting attributes of elements: $('<element name>').attr('<attribute name>') *setting attributes of elements: $('a').attr({<attribute name>: '<value>', <attribute name>: '<value>'}); ====ajax()==== There are two version ajax(url,options) and ajax(options) ([http://api.jquery.com/jquery.ajax/ offical doc]), but in most cases the latter is used. Options is an array of key value pairs: $.ajax({ url: url, dataType: 'json', // type of data that you're expecting back from the server data: data, // data to be sent to the server success: callback, // has 3 parameter: data returned from server of type 'dataType', status string, XMLHttpRequest error: function (jqXHR, textStatus, errorThrown) // errorThrown is the text equivalent for the return code }); returns a jQuery XMLHttpRequest (jqXHR) object. ====jQuery()==== *'''$()''' is short of jQuery() ====getJSON()==== $.getJSON('car-sale-report.json', function() { //callback }); is equivalent to [[#ajax.28.29|ajax()]].
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width