...

View Full Version : document.domain (not accurate)



sitNsmile
07-28-2011, 06:17 PM
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?

sitNsmile
07-29-2011, 12:43 AM
Anyone have a clue?

sitNsmile
07-29-2011, 11:04 PM
I hate bumps, but obviously no one seems to have a clue at what I am talking about. How much I hate client-side.

Philip M
07-30-2011, 07:51 AM
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.

rnd me
07-30-2011, 08:34 AM
alert(
document.getElementsByTagName("script")[
document.getElementsByTagName("script").length -13
].src.split("/")[2]
)

sitNsmile
07-31-2011, 10:17 PM
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.

sitNsmile
07-31-2011, 10:48 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum