Implement jquery to load data immediately on the startup page
This time I will bring you how to implement jquery to load data immediately on the startup page, and implement jquery to load data immediately on the startup page. What are the precautions?The following is a practical case, let's take a look.
In fact, the important thing is this method:
$(document).ready(function(){ }
Specifically in jquery:
For specific how to use ajax, you can check out my last blog "A brief discussion of ajax requests in jquery and responses in servlet"
<script type="text/javascript"> $(document).ready(function(){ var str = ""; var strA = ""; $.ajax({ type: "GET", url: "<%=path%>" + "/queryOrder.do", dataType: "json", async:false, data:{ }, success: function(data){ for (var i in data) { var num = parseInt(i) + 1; var status = data[i]['status']; if( status == 0 || status == -4){ strA = '<a class="m1" value="'+ data[i]['orderId'] +'">未处理</a>'; }else if( status == -1 || status == -2){ strA = '<a class="m2" value="'+ data[i]['orderId'] +'">已接受</a>'; }else if( status == -3){ strA = '<a class="m3" value="'+ data[i]['orderId'] +'">已完成</a>'; } str +="<tr><td>" + num + "</td><td>" + data[i]['ownerName'] + "</td><td>" + data[i]['telephone'] + "</td><td>" + data[i]['hopeTimeName'] + "</td><td>" + data[i]['build'] + "</td><td>" + data[i]['description'] + "</td><td>" + strA + "</td>"; + "</tr>"; } $(".tabletr").after(str); }, error: function(data){ } }) }); </script>
in jsp:
<p class="tab-pane active" id="A" style="text-align:center;"> <p class="row marg" > <h3>维修单</h3> <table border="2 " style="width:100%;text-align:center;"> <tr class="tabletr"> <th>序号</th> <th>业主名</th> <th>联系方式</th> <th>时间</th> <th>地址</th> <th>项目描述</th> <th>状态</th> </tr> </table> </p> </p>
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!
Recommended reading:
Realize the linkage effect between the input box and the drop-down box
##Use jquery to operate the text content of the input box
The above is the detailed content of Implement jquery to load data immediately on the startup page. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

Title: Implementation method of page jump in 3 seconds: PHP Programming Guide In web development, page jump is a common operation. Generally, we use meta tags in HTML or JavaScript methods to jump to pages. However, in some specific cases, we need to perform page jumps on the server side. This article will introduce how to use PHP programming to implement a function that automatically jumps to a specified page within 3 seconds, and will also give specific code examples. The basic principle of page jump using PHP. PHP is a kind of

"Methods to handle Laravel pages that cannot display CSS correctly, need specific code examples" When using the Laravel framework to develop web applications, sometimes you will encounter the problem that the page cannot display CSS styles correctly, which may cause the page to render abnormal styles. Affect user experience. This article will introduce some methods to deal with the failure of Laravel pages to display CSS correctly, and provide specific code examples to help developers solve this common problem. 1. Check the file path. First check the path of the CSS file.

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

Title: Introduction to how to delete a page of content in Word When editing a document using Microsoft Word, you may sometimes encounter a situation where you need to delete the content of a certain page. You may want to delete a blank page or unnecessary content on a certain page in the document. In response to this situation, we can take some methods to quickly and effectively delete a page of content. Next, some methods to delete a page of content in Microsoft Word will be introduced. Method 1: Delete a page of content First, open the Word document that needs to be edited. Certainly

How to tell if a jQuery element has a specific attribute? When using jQuery to operate DOM elements, you often encounter situations where you need to determine whether an element has a specific attribute. In this case, we can easily implement this function with the help of the methods provided by jQuery. The following will introduce two commonly used methods to determine whether a jQuery element has specific attributes, and attach specific code examples. Method 1: Use the attr() method and typeof operator // to determine whether the element has a specific attribute
