最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery.url is undefined - Stack Overflow

programmeradmin1浏览0评论

I use this script:

$(document).ready(function() {

         $page = jQuery.url.attr("file");

         alert(page);


       });

but I get error jQuery.url is undefined and through firebug I was able to make sure that jquery.js is loaded

please advise

thanks

I use this script:

$(document).ready(function() {

         $page = jQuery.url.attr("file");

         alert(page);


       });

but I get error jQuery.url is undefined and through firebug I was able to make sure that jquery.js is loaded

please advise

thanks

Share Improve this question asked Mar 31, 2012 at 23:23 zaczac 4,95816 gold badges73 silver badges138 bronze badges 2
  • 3 You really shouldn't prefix your non-jQuery-object variables with $. It is ugly and will confuse people (including you, in the line after you did not add the $). Besides that, use var to avoid creating globals. – ThiefMaster Commented Mar 31, 2012 at 23:26
  • Thanks alot ThiefMaster I appreciate your advices and will do it – zac Commented Apr 1, 2012 at 1:39
Add a ment  | 

1 Answer 1

Reset to default 8

There is no built-in $.url function. You're missing the jQuery URL plugin.

发布评论

评论列表(0)

  1. 暂无评论