开发者

undefined error in jquery

开发者 https://www.devze.com 2023-02-15 16:40 出处:网络
I get here as x undefined error. In my tr tag I have used this code (in a.php)开发者_运维知识库:

I get here as x undefined error. In my tr tag I have used this code (in a.php)开发者_运维知识库:

echo "<tr data-x'some php value'>"; 

In b.php I'm using code like this:

window.location = 'c.php?x=' + $(this).data('x');


You should use data(key) when you have put the information with data(key, value). Use attr(key) in this case: "window.location = 'c.php?x=' + $(this).attr('x');"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号