...

View Full Version : HELP with "null" is null or not an object



xpgo
05-10-2007, 11:58 PM
Hello,

I run a vbulletin forum.
Using mozilla, everything goes fine.
But using IE, i always get a message "done but with errors on page". And them looking at error, i see "error: "null" is null or not an object"!


I checked and this error comes from a javascript code i'm using.
I'm using JK Popup generator script: http://www.javascriptkit.com/popwin/index.shtml

Anyone can help me out?
Thanks

christslove
05-11-2007, 12:09 AM
It would be helpfull to see the code, not a window with a way to generate multiple codes.... please give a direct link to the code, or post it. Thanks

Matt

xpgo
05-11-2007, 12:16 AM
Sure, here is the code i'm using, inside header template:




<script type="text/javascript">

//JK Popup Window Script (version 3.0)- By JavaScript Kit(http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use
//Win Type: Pop Under | 5 minutes period

//Specify URLs to randomly select from and popup/popunder:
//To display a single URL, just remove all but the first entry below:
var popurls=new Array()
popurls[0]="http://www.mywebsitedomain.com"


function openpopup(popurl){
var winpops=window.open(popurl,"","width=820px,height=700px,scrollbars")
winpops.blur()
window.focus()
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

popfrequency="5 minutes"

function resetcookie(){
var expireDate = new Date()
expireDate.setMinutes(expireDate.getMinutes()-10)
document.cookie = "jkpopunder=;path=/;expires=" + expireDate.toGMTString()
}

function loadornot(){
if (get_cookie('jkpopunder')==''){
openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
var expireDate = new Date()
expireDate.setMinutes(expireDate.getMinutes()+parseInt(popfrequency))
document.cookie = "jkpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
}
}

if (get_cookie('jkpopunder')!=parseInt(popfrequency))
resetcookie()
loadornot()

</script>

christslove
05-11-2007, 12:21 AM
I wish I could help, but I dont know much about cookies..... you may wanna tell everyone else what it does though, and maybe post the html that relates to it

Matt

xpgo
05-11-2007, 12:24 AM
it just opens a popup window to my visitors, every 5 minuts.

liorean
05-11-2007, 12:29 AM
it just opens a popup window to my visitors, every 5 minuts.Most likely, the error is caused by a popup blocker preventing the popup. I haven't tried your code or anything, but that's my gut feeling.

christslove
05-11-2007, 01:40 AM
Yeah, it's a pop-up blocker..... Just turn off your pop-up blocker and it works perfectly.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum