jQuery load content from link with Ajax

后端 未结 4 1124
[愿得一人]
[愿得一人] 2020-12-15 15:08

I have a -link element that has href link to page, but I have to use Ajax to load that content from href -url and not redirect user to that page. How can I modify my link to

4条回答
  •  执笔经年
    2020-12-15 15:21

    @bjelli is kinda right. But you might want to have your e.preventDefault(); before your AJAX call or everything else you wanted to do in the first place, because you really don't want a clients old and slow browser to even try to load the initialy requested resource.

    Even though some programming languages can do some magic, most scripts work from the top to the bottom of your very script.

提交回复
热议问题