SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Url to jQuery

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Url to jQuery

    I wrote my first script but it does not work.

    From a url:

    http://www.mysite.com/page.aspx?var1=123&var2=987

    Code:
         <script src="~/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
            <script language="javascript" type="text/javascript">
                $(document).ready(function() {
                    var GET1=$("#TextBox22");
                    var GET2=$("#TextBox23");
                    GET1.val($.url("?var1"));
                    GET2.val($.url("?var2"));
                });
            </script>
    where am I going wrong?

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    jQuery doesn't have any method called url() which is why your above code isn't working, you will need to include the $.url() plugin which you can download from https://github.com/websanova/js-url.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •