将灯箱更改为 Ajax 调用
我正在尝试重写此链接,这样它不会链接到灯箱,而是进行 ajax 调用并更新
<div class="add-rule>"<a href = "/saffron_main/add_rule?type=tid&mid=0&cid=1&m-name=valid" class="lightwindow" params="lightwindow_type=external,lightwindow_height=100,lightwindow_width=300">Add a rule</a></div>
我的 链接Javascript 和 Ajax 新手,因此我们将不胜感激。
I am trying to rewrite this link so instead of linking to a light box, it makes an ajax call and updates the contents of <div class = "add-rule>
. Here is the link
<div class="add-rule>"<a href = "/saffron_main/add_rule?type=tid&mid=0&cid=1&m-name=valid" class="lightwindow" params="lightwindow_type=external,lightwindow_height=100,lightwindow_width=300">Add a rule</a></div>
I am new to Javascript and Ajax, so any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
代码应该看起来像这样(无法检查这个,但我离得不远)
有关详细信息,请查看 jquery 的 ajax api
您可能对加载函数感兴趣。
这是我的代码,请告诉我是否合适
The code should look some like this (couldn't check this out but I am not far away)
For more info have a look at jquery's ajax api
and you might be interested in the load function.
This is my code, let me know if it fits or not