i have get a null reference problem in javascript on my site

Forums » General Opera topics » User JavaScript

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

14. May 2012, 06:41:34

mobilya

Posts: 1

i have get a null reference problem in javascript on my site

İ use this code on my site but when site opens, I have get a null reference error.
When I open my site a second time, this error doesn't occur.
I understand when the site caches, this error doesn't occur. The error comes from tb_show function.
but i dont solve the problem

My code:
<script type="text/javascript">
function writeCookie(CookieAdi) {
var dtGun = 1
var strValue = "1"
if (dtGun == null || dtGun == "") dtGun = 365;
var d = new Date();
d.setTime(d.getTime() + (dtGun * 24 * 60 * 60 * 1000));
var zt = "; expires=" + d.toGMTString();
document.cookie = CookieAdi + "=" + strValue + zt + "; path=/";
}
function readCookie(cookieadi) {
var c = document.cookie;
if (c.indexOf(cookieadi) != -1) {
s1 = c.indexOf("=", c.indexOf(cookieadi)) + 1;
s2 = c.indexOf(";", s1);
if (s2 == -1) s2 = c.length;
strValue = c.substring(s1, s2);
return strValue;
}
}
writeCookie('OnerFacebook');
if (readCookie('OnerFacebook') != 1) {
tb_show('', 'http://www.mobilyala.com/OnerFacebook/?KeepThis=true&TB_iframe=true&height=500&width=300&modal=true', '');
}
</script>

20. May 2012, 01:15:12

spadija

Posts: 1638

What is tb_show? Is this a function you wrote or part of a library you are using?

Forums » General Opera topics » User JavaScript