jquery refresh the page-based approach, and some javascript functions

jquery refresh the page partial refresh:

This method more to go, and often there are several;

$. get method, $. post method, $. getJson method, $. ajax as follows

The first two use basically the same

$. get ( "Default.php", (id: "1", page: "2"),
function (data) (
/ / Here is the callback method. Returned data data. Here like how handle how handled.

$. getScript methods:

$. getScript ( "http://jqueryajax.com/jquery.js",
function () (
$ ( "# Go"). Click (function (){// callback methods
$ ( ". Block"). Animate ((backgroundColor: 'pink'), 1000)
. animate ((backgroundColor: 'blue'), 1000);

$. getJson only return data type is not the same as

$. getJson ( "Default.php", (id: "1", page: "2"),
function (data) (
/ / Note that the returned JSON data reference method "data.info", do not understand can check out the json in tutorial. Here is not to explain too much

$. ajax this approach is estimated using a lot of people bar. But I not like use this. Personally feel that the first two more convenient

$. ajax ((
type: "POST", / / submitted to the type of
url: "some.php", / / submit address
data: "name = John & location = Boston", / / parameter
success: function (msg) (/ / callback method
alert ( "Data Saved:" + msg); / / Here is a method and content, and above get the same way as

Here are full-page refresh method: may sometimes be used
window.location.reload () Refresh the current page.
parent.location.reload () refresh the father object (for frame)
opener.location.reload () refresh the parent window object (for the single open window)
top.location.reload () refresh top objects (for multi open windows)

Next, introduce some javascript basic functions

1.document.write (""); for the output statement
2.JS the comment is / /
3. Traditional HTML document order is: document-> html-> (head, body)
4. A browser window DOM order is: window-> (navigator, screen, history, location, document)
5. To be in the form element names and values: document.getElementById ( "form element ID numbers"). Name (or value)
6. A lowercase turn capitalized JS: document.getElementById ( "output"). Value = document.getElementById ( "input"). Value.toUpperCase ();
7.JS the value types: String, Number, Boolean, Null, Object, Function
8.JS the character into numeric: parseInt (), parseFloat ()
9.JS in the digital conversion into a character :(""+ variables)
10.JS of taking the string length is: (length)
11.JS characters and the characters are connected using the + sign.
12.JS in comparison operators are: == equal,! = Not equal to ,>,>=,<.<=
13.JS declare a variable use: var to carry out the statement
14.JS in judgments statement structure: if (condition) () else ()
15.JS in the loop structure: for ([initial expression]; [condition]; [upadte expression]) (inside loop)
16. Circulatory arrest of the command is: break
17.JS in the function definition: function functionName ([parameter], ...) (statement [s])
18. When the file appears in multiple form form. Can use document.forms [0], document.forms [1] instead.
19. Window: Open the window window.open (), close a window: window.close (), the window itself: self
20. The status bar settings: window.status = "character";
21. Pop-up tips: window.alert ( "character");
22. Pop-up confirmation box: window.confirm ();
23. Pop-up enter the prompt box: window.prompt ();
24. Specify the currently displayed link location: window.location.href = "URL"
25. Remove the form of all forms of quantity: document.forms.length
26. Close the document output stream: document.close ();
27. String additional connectors: + =
28. To create a document element: document.createElement (), document.createTextNode ()
29. Are elements of the method: document.getElementById ()
49. Refers to a file-type JS: <script type="text/javascript" src="aaa.js"> </ script>
50. Specify does not support the script that the browser displays HTML: <noscript> </ noscript>
51. When the hyperlink, and ONCLICK events there, then the older versions of the browser, turning a.html, or else turned b.html. Example: <a href = "a.html" "location.href = 'b.html'; return false "> dfsadf </ a>
52.JS built-in objects are: Array, Boolean, Date, Error, EvalError, Function, Math, Number, Object, RangeError, ReferenceError, RegExp, String, SyntaxError, TypeError, URIError
53.JS in the exchange line: \ n
54. Window full-screen size: <script> function fullScreen () (this.moveTo (0,0); this.outerWidth = screen.availWidth; this.outerHeight = screen.availHeight;) window.maximize = fullScreen; </ script "
55.JS of all on behalf of its middle and lower classes of all elements of

56.JS focus in the order: document.getElementByid ( "form element"). TabIndex = 1
57.innerHTML value is the form element's value: If <p"para"> "how are <em> you </ em>" <p> </ p>, then the innerHTML value of is: how are <em> you </ em>
58.innerTEXT values and, like the above, but will not <em> this tag is displayed.
59.contentEditable can set whether the element can be modified, isContentEditable return editable state.
60.isDisabled to determine whether to prohibit the state. Disabled is set to prohibit the state
61.length to obtain length, returns an integer value
62.addBehavior () is a JS call to an external function file its extension. Htc
63.window.focus () so that the current windows on all windows.
64.blur () means a loss of focus. And FOCUS () the opposite.
65.select () means the elements selected.
66. To prevent users from text box, type the text: onfocus = "this.blur ()"
67. Remove the element appear in the page number: document.all.tags ( "div (or any other HTML tags)"). Length
68.JS form is divided into two kinds of output: modal and non-modal. Window.showModaldialog (), window.showModeless ()
69. The status bar text settings: window.status = 'text', the default status bar text settings: window.defaultStatus = 'word.';
70. Add to Favorites: external.AddFavorite ( "http://www.google.com", "Google");
71.JS encountered an error when the script without any action: window.onerror = doNothing; specify the error handling syntax is: window.onerror = handleError;
72.JS specified in the currently open window, the parent window: window.opener, support for multiple opener.opener ... continued.
73.JS of the self refers to the current window
74.JS in the status bar displays the contents of: window.status = "content"
75.JS in the top refers to the framework of the centralized top-level framework for
76.JS close the current window in: window.close ();
77.JS made sure the box is: if (confirm ( "Are you sure ?")){ alert (" ok ");) else (alert (" Not Ok ");)
78.JS in the window redirection: window.navigate ( "http://www.google.com");
79.JS in print: window.print ()
80.JS the prompt input box: window.prompt ( "message", "defaultReply");
81.JS in the window scroll bar: window.scroll (x, y)
82.JS in the window scroll to the location: window.scrollby
83.JS set the time interval: setInterval ( "expr", msecDelay) or setInterval (funcRef, msecDelay) or setTimeout
84.JS in the modal appears in IE4 + line, in the NN in the No: showModalDialog ( "URL" [, arguments] [, features]);
85.JS used prior to the withdrawal of the handle: function verifyClose () (event.returnValue = "we really like you and hope you will stay longer .";}} window.onbeforeunload = verifyClose;
86. When the form is used when the first call to the file handle: onload ()
87. When the form closes called file handles: onunload ()
88.window.location attributes: protocol (http:), hostname (www.example.com), port (80), host (www.example.com:80), pathname ( "/ a / a.html") , hash ( "# giantGizmo", means a jump to the corresponding anchor in mind), href (all information)
89.window.location.reload () Refresh the current page.
89-1.parent.location.reload () refresh the father object (for frame)
89-2.opener.location.reload () refresh the parent window object (for the single open window)
89-3.top.location.reload () Refresh the top of the object (for multiple open windows)
90.window.history.back () Back to previous page, window.history.forward () return next, window.history.go (return to the first few pages, you can also use the visited URL)
91.document.write () does not wrap the output, document.writeln () for line output
92.document.body.noWrap = true; to prevent the link text off-line.
93. Variable names. CharAt (first few), taking the variable of the first few characters.
94. "Abc". CharCodeAt (first few), returns the first few characters of the ASCii code value.
95. String concatenation: string.concat (string2), or connect + =
96. Variable. IndexOf ( "character", the starting position), returns the first occurrence of a position (starting from 0 rates)
97.string.lastIndexOf (searchString [, startIndex]) the location of the last occurrence.
98.string.match (regExpression), to determine whether it matches the character.
99.string.replace (regExpression, replaceString) to replace the existing string.
100.string.split (separator) returns an array of storage values.
101.string.substr (start [, length]) obtained from the first of several to the specified length of the string.
102.string.toLowerCase () so that all the string into lowercase.
103.string.toUpperCase () so that all characters into uppercase.
104.parseInt (string [, radix (on behalf of binary)]) cast into an integer.
105.parseFloat (string [, radix]) cast into a float.
106.isNaN (variable): Test whether numeric.
107. Define constants keywords: const, define variables keyword: var
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of jquery refresh the page-based approach, and some javascript functions

  • jquery ajax example

    1. Check js file $. ajax (( type: "GET", url: "test.js", dataType: "script" )) 2.post data $. ajax (( type: "POST", url: "xxxx", data: "name = zhaoaiqing & age = 25", success: function ( ...

  • hibernate study of the second

    Persistence of three main points: 1, a statement for persistent fields accessors (accessors) and whether the variable signs (mutators) Property statement is not necessarily required for the public's. Hibernate can be default, protected or private ...

  • JS after ajax request return of the problem can not be implemented

    1: Send ajax request, in the onComplete, if back when the html contains a javascript, then these javascrip and will not be realized, it does not mean not to implement. This problem has troubled me for a long time, behind the hair and then put this kn ...

  • Strength of live practice teaching materials, suitable for each person team look - UFIDA Hua Table CTO talk about "out of the software factory"

    A few months ago, on reading "Going the software factory," one book, not yet published at that time, it can be considered the reference of the watch. Although the language rather uneventful, but the contents of people really can not but carry on

  • Workspace run under different Eclipse

    Now do live more and more often required to use eclipse in java and ruby & rails project conducted between the tangential shear from the past, because in the rails project used a coloring Aptana preferences, the results open the java project sour ...

  • Software development sunflower Baodian [reprint]

    Master the ability to reuse code very familiar with the new API's fast. This is because, he once used a lot of the API, have a lot of reusable code. He knows what is available and what is deficient. He has been using Qt, also used by gtk +, also used

  • JS charts extjs implementation tools can be combined

    OpenFlashChart brief introduction by valensoft 2009-1-10 8:29:00 OpenFlashChart is an open source Flash and Javascript to the technical foundation for the free chart, using it to create some very useful analysis of the effect of the statements of the char

  • Hibernate Inteceptor

    The end of the project stage, the client suddenly put forward a very troublesome but normal demand, the system records all changes must be carried out. Formats such as: 2004.1.1 12:30 Ikuya wind orders Sales Order Date 2004.1.2-> 2004.1.3 The firs ...

  • can not be represented as java.sql.Timestamp

    Development of procedures for the use of hibernate when, some time there is no need to fill in the fields, but after the hibernate query time reported "Java.sql.SQLException: Value'0000-00-00 'can not be represented as java.sql.Timestamp ...

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries