Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder sitNsmile's Avatar
    Join Date
    Dec 2009
    Location
    Charlotte, NC
    Posts
    358
    Thanks
    19
    Thanked 2 Times in 2 Posts

    Exclamation document.domain (not accurate)

    Okay, reason I say that is, its not accurate to the actual domain that the "script" is located on.

    For example, domain.com has the <script url=domain2.com/jsfile> which has
    " document.domain " (this = domain.com)

    However, if i have frame of domain3.com which frames domain.com the domain will show domain3.com but thats not what I care about, I want domain.com since thats whats actually being shown.

    Any possible fixes to this?

  • #2
    Regular Coder sitNsmile's Avatar
    Join Date
    Dec 2009
    Location
    Charlotte, NC
    Posts
    358
    Thanks
    19
    Thanked 2 Times in 2 Posts
    Anyone have a clue?

  • #3
    Regular Coder sitNsmile's Avatar
    Join Date
    Dec 2009
    Location
    Charlotte, NC
    Posts
    358
    Thanks
    19
    Thanked 2 Times in 2 Posts

    Exclamation

    I hate bumps, but obviously no one seems to have a clue at what I am talking about. How much I hate client-side.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,015
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by sitNsmile View Post
    I hate bumps, but obviously no one seems to have a clue at what I am talking about.
    You are so right. Try re-phrasing your question to make it easier for us to understand what the issue is.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,346
    Thanks
    11
    Thanked 589 Times in 570 Posts
    Code:
    alert(
      document.getElementsByTagName("script")[
         document.getElementsByTagName("script").length -13
      ].src.split("/")[2]
    )
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • #6
    Regular Coder sitNsmile's Avatar
    Join Date
    Dec 2009
    Location
    Charlotte, NC
    Posts
    358
    Thanks
    19
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Philip M View Post
    You are so right. Try re-phrasing your question to make it easier for us to understand what the issue is.
    Sorry about that, let me give a more detailed demonstration.


    the website is domain-1.com.
    the script website (where the javascript (js) file will be hosted at is domain-2.com)

    so on domain-1.com I have <script src="http://domain-2.com">
    (its a script using "document.domain") so that domain-2.com can be used on multiple sites without having to reconfigure for a particular domain)

    Now what I see whats happening is something I'd like to know if there is an alternative.

    for the instance, there is a domain-3.com (I have no clue who they are) however when I record stats from my script for domain-1.com, domain-3.com comes up, and im guessing because he has "iframed" domain-1.com, now thats not accurate because the script is not on domain-3.com, but he still is added into stats from the javascript.

  • #7
    Regular Coder sitNsmile's Avatar
    Join Date
    Dec 2009
    Location
    Charlotte, NC
    Posts
    358
    Thanks
    19
    Thanked 2 Times in 2 Posts
    I have run through a lot of testing for this, and cant seem to replicate the issue myself, however the data doesn't lie. My guess is it could be bots, these days advanced bots can read/execute javascript.

    but if i tell the system to record all the document.domain, I receive a lot more than I originally wanted from that variable.


  •  

    Posting Permissions

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