Before always using the Window.onload method to invoke the JS method to achieve, today tangled can be implemented in a different way.It's obvious that it's possible.In the HTML foreground page reference JS code as follows@Scripts. Render ("~/scripts/
Resolves Ajax cross-domain issues: Origin xx is not allowed by Access-control-allow-origin.Today an AJAX cross-domain problem, tangled in my half-day, record it.HTML>Head> title>Titletitle> Scriptsrc=
1. the most classic problem is the cache problem in IE. If get is used, a cache problem occurs in IE. The code is executed only once. The solution is to add a timestamp or random number to make the URL unique so that no IEOr change to post for
Generally, parameters submitted using Ajax are simple strings. You can directly use the get method to write the parameters to be submitted to the URL parameters of the open method, the parameter of the send method is null.
For example:
VaR url =
I wrote a small article to commemorate the 7th event.
Submit is generally used to submit a form. However, if you want to use Ajax for submission, you also want to press the "enter" trigger button.
In this case, the form submission event is blocked
In IE9, Ajax cannot refresh the data cache. Solution: ie9ajax
Use jQuery's getJSON to regularly retrieve data from the background and refresh the interface. When using the following methods, there is no problem in Chrome or Firefox, but the data
How does ajax set timeout (an action is executed twice)? ajaxaction
Today, during the test project, we found that an action was executed twice. This operation took about five minutes to complete. The project environment was apache2 +
Before reading this article, specify a common variable xhr and xhr code ajax object. Test Browser: ie is ie6, firefox is 2, and others are not tested. Ie6 is Internet Explorer and firefox2 is ff.The most classic problem is the cache problem in
As long as we use js settimeout and div to combine the countdown, we can achieve the display time per second. Below we have sorted out an example used in our work and shared it with you.
The countdown function is used in many previous activity pages.
In the past, we often saw a website with the webpage skin replacement function. Today I will introduce how to skin the webpage. Here we mainly use the css + js cookies for operations, the following is a detailed introduction.
Preparations required
In js, the most common numeric data is used for comparison. However, if I directly perform normal comparison, problems may occur, next, I will introduce some considerations when comparing the size.
Use js to obtain the values of the two numeric
The replace method is a commonly used character replacement method in Javascript. It can directly replace a specified string or write multiple regular expression rules in the replace method to replace, the following describes how to use the replace
When the trim attribute in jquery is used today,: $ ('input [type = \ 'text \ ']: eq (0 )'). val (). trim (), error in ie7/8: The object does not support the "trim" attribute or method. Next I will introduce the solution for you.
Solution:
Method 1:
In js, there are many ways to use this. The following describes the common usage of this in js, anyone who needs to know how to use this will not be able to refer to it.
Let's take a look at what this points to in the following situations:
1. In the
Print to print a webpage is a simple task, but sometimes we want to print the content of a specified area. Next I will introduce how to print the webpage code in a specified area using print.
Relatively simple method
Use CSS to define a. noprint
The _ FILE _ constant like PHP does not exist in javascript files for us to obtain the path of the current FILE. After research, we can use the following methods:
1. Get the current JS file path in jQuery
It is relatively simple to obtain the path
Window. opener opens a new window in js. Next I will introduce some usage and summary of window. opener to you.
I used to think that window. opener can be accessed only when window. open is opened. I didn't expect that even the page opened by a link
This article introduces how to solve the conflict between function $ (id) and jquery in js. If you have encountered such problems, refer.
$ (Id) is js document. the abbreviation of getElementById (id) defines the $ ("img-icon") that can be directly
This article will introduce you to the full-site AJAX case details of jQuery Address. In order to improve user experience and improve the front-end page effect, more and more Web applications and websites of enterprises or individual groups are
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service