Jump to content

[SOLVED] Error


qbox

Recommended Posts

When I open the site with FireFox everything work perfect but with IE I have error

object doesn't support this property or metod......

Code = 0

etc.

What is the problem.

I only collect information like resolution, browser etc. and send them out.

 

var warname = {

  init:function(){

.....

  warname.onLoad();

},

  onLoad:function(){

  (i collect information here and send them)

  }

}

 

window.addEventListener("load", function() { warname.init(); }, false);

Link to comment
Share on other sites

here it is

I generate this code in PHP. I call that php like counter.php?site=mysite

var myCounter =
{
init:function(mServer, mSesionID){
	myCounter.Site=\"".$_GET['site']."\";
	myCounter.Server=mServer;
	myCounter.SesionID=mSesionID; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<--------------------------
	myCounter.IP=\"".$_SERVER['REMOTE_ADDR']."\";
	myCounter.trackingImage = new Image();

	myCounter.OnLoad();
},

OnLoad:function(){
	var newHref   = document.createElement(\"a\");
	var newImage  = document.createElement(\"img\");
	var scriptRef = myCounter.getScriptElement();

	var data=new Date();
	var mTZO=(typeof(data.getTimezoneOffset)!='undefined') ? data.getTimezoneOffset() : '';
	newHref.href = \"http://\" + myCounter.Serve + \"/counter/Statistic.php?site=\" + myCounter.Site;
	newHref.target = \"_top\";

	var mImage = \"http://\" + myCounter.Server + \"/counter/counting.php?site=\" + myCounter.Site; 
	if (myCounter.IP != \"\")
		mImage += \"&ip=\"+myCounter.IP;
	mImage += \"&w=\"+window.screen.width; 
	mImage += \"&h=\"+window.screen.height;
	mImage += \"&clr=\"+window.screen.colorDepth;
	mImage += \"&tzo=\" + mTZO;
	mImage += \"&lang=\"+escape(navigator.language ? navigator.language : navigator.userLanguage);
	mImage += \"&pg=\"+escape(document.location);
	mImage += \"&js=1\";
	if(navigator.cookieEnabled)
		mImage += \"&co=1\";
	else
		mImage += \"&co=0\";
	if(navigator.cpuClass)
		mImage += \"&cpu=\"+navigator.cpuClass;
	else
		mImage += \"&cpu=0\";

	newImage.border = \"0\";
	newImage.src = mImage;
	newHref.appendChild(newImage);

	myCounter.trackingImage.src = mImage;
},

getScriptElement:function()
{
	var refScript=null;
	refScript = document.getElementById( \"myCounter\" );
	if (refScript)
		return refScript;

	var pageScripts = document.getElementsByTagName(\"script\");
	for(var i=0;i<pageScripts.length;i++)
	{
		if (pageScripts[i].src)
		{
			var mSource = pageScripts[i].src.toLowerCase();
			if (mSource.indexOf(\"site=\" + myCounter.Site) > 0)
				return pageScripts[i];
		}
	}

	return null;
}
}
window.onload = function() { 
myCounter.init(); 
};

 

I want to use it to count and log visitors on my page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.