www.webdeveloper.com
Results 1 to 2 of 2

Thread: A number of the base Server that the url is coming from

  1. #1
    Join Date
    Sep 2010
    Posts
    68

    A number of the base Server that the url is coming from

    I have a Server with a url of "www.site.com". I have urls of "www.site.com/folder1/index.htm". I want to somehow show the base url "www.site.com" or a number of the base Server that the url is coming from in Javascript.

  2. #2
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    594
    Try this:
    Code:
    alert(document.location.href.split('\/')[2]);
    Please give me a hand at http://www.gofundme.com/bkzr98.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles