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

分类:Web 时间:2008-06-07 人气:722
blog comments powered by Disqus


  • JavaScript Ajax Json实现上下级下拉框联动效果实例代码 2014-06-20

    这篇文章主要介绍了JavaScript Ajax Json实现上下级下拉框联动效果实例代码,有需要的朋友可以参考一下 最近尝试做出一个部门和人员的下拉框联动功能,部门和人员的对应关系是1:N <div class="forntName">部门</div> <div class="inpBox"> <select name="department" id="department" onchange="change();" style="width:200p

  • By YUI2.8 of AJAX, JSON format to pass data back-end forward 2010-05-14

    Recent study and use of YUI2.8, success in the local debugging using YUI2.8 of AJAX, JSON format to pass data back-end forward, and now to document it for future use. Note: I saw "YUI + struts2 AJAX implementation example of communication based on JS

  • asp.net中利用Jquery+Ajax+Json实现无刷新分页的实例代码 2014-04-24

    本篇文章主要是对asp.net中利用Jquery+Ajax+Json实现无刷新分页的实例代码进行了介绍,需要的朋友可以过来参考下,需要对大家有所帮助 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxJson.aspx.cs" Inherits="AjaxJson" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:

  • servlet + jquery ajax + json demo 2010-07-16

    1. The corresponding jar package imports. Json-lib-2.2.3-jdk15.jar, ezmorph-1.0.6.jar so. 2. Join jquery.js 3. Jquery each () method to use api. http://api.jquery.com/jQuery.each/ 4. Server servlet program import javax.servlet.http.HttpServlet; import jav

  • Ajax json Asynchronous interactive access to database data 2010-09-13

    Main achieved in this case the data transfer can be selected automatically after the database will be a database table name to display the page The use of a dynamic interactive Ajax 1. Interface: where the focus is mainly achieved some javaScript asynchro

  • used in the struts framework jquery AJAX, json data format to submit data that 2010-12-31

    This demo shows the main use of jquery's ajax, using the struts2 framework, json data format, so in addition to import the necessary jar struts2 package, the package had to plug into json. 1. First create a form. <form action="" method="post"> N

  • Ajax+Json 级联菜单实现代码 2014-09-09

    Ajax+Json 级联菜单实现代码,需要的朋友可以参考下。 第一个下拉框: <select id="select" name="rawfoodBasic.category" onchange="doChange(this.value);"> //第一个下拉框里的值 </select> 第二个下拉框: 复制代码 代码如下: <select id="subSelect" name="rawfoodBasic.absorb" onchange="javascript:a

  • Use JQuery with Ajax.JSON 2010-06-21

    JSON (JavaScript Object Notation) data format, a simple, more compact than the xml. JSON format is native JavaScript, which means dealing with JSON in JavaScript, the data does not need any special API or tool kit. JSON rules are simple: the object is a d

  • json in javascript Learning Summary 2010-06-29

    1. Javascript to json version there are two links 1 http://www.json.org/json.js Link 2 http://www.json.org/json2.js 2. First of all, need to introduce <script type="text/javascript" src="js/json/json版本.js"> </ script>

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.138 (s). 14 q(s)