惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
L
LangChain Blog
C
Check Point Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
Recent Announcements
Recent Announcements
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
U
Unit 42
The Cloudflare Blog
月光博客
月光博客
有赞技术团队
有赞技术团队
G
Google Developers Blog
Vercel News
Vercel News

博客园 - 蜡人张

Reading Materials in Several Minutes 一个批处理文件 - 蜡人张 - 博客园 T-SQL中的ISNULL和IS NULL 随便写写(12) C#向Word文档中插入条形码 随便写写(9) 随便写写(8) Balsamiq Mockups Ext GridPanel 动态生成列 demo Silverlight Dashboard and Gauge Elements Drawed in Expression Blend 野路子实现的轻量级伪OLAP展示 Silverlight形状合并:绘制半圆 SPAW Editor .NET Edition v.2乱用:使用代码调整编辑器高度 随便写写(5) SPAW Editor .NET Edition v.2乱用 Windows Live Writer没有权限设置字体501错误 HowTo (2): 在WebBrowser控件中屏蔽脚本错误 WM Concepts 1: Windows CE Windows Mobile 6 Professional SDK Refresh安装错误“系统管理员设置了系统策略,禁止进行此安装”
XMLHttpRequest异步时的超级链接调用函数问题
蜡人张 · 2008-08-13 · via 博客园 - 蜡人张

    使用超级链接调用Javascript函数时,可以使用href属性或onclick属性,如

<href="javascript:test();" title="Call Function">Call Function test()</a>


    或

<href="#" onclick="test();" title="Call Function">Call Function test()</a>

    但是如果被调用的函数中存在使用XMLHttpRequest进行异步通信的情况,请不要使用第一种方式,否则异步将无法体现出来。

    如下的调用方式和第一种方式类似不能达到异步的目的:

<href="javascript:void(0);" onclick="test();" title="Call Function">Call Function test()</a>

    

Life is like a boat, and I'm at sea.