开发者

Object expected, javascript error

开发者 https://www.devze.com 2023-01-25 20:20 出处:网络
Please check out this code? why do i get object xpected error? Thank you... var object_url = \"http://test.com/flash/custom-freechat/\";

Please check out this code? why do i get object xpected error? Thank you...

 var object_url = "http://test.com/flash/custom-freechat/";
        var param_url = "category=boy&subcategory=18_22&tags=boy,18_22&ismember=false&appletbrand=jasmin&subbrand=livejasmin&size=1&appletcol=&txtcolor1=&txtcolor2=&txtcolor3=&txtcolor4=&txtcolor5=&txtcolor6=&txtcolor7=&txtcolor8=&txtcolor9=&txtcolor10=&membcol=&guestcol=&asc=GGGGGG&lowCamFeed=false&muteAudio=false&as=0111111011110010&ato=0&isproxy=1&sessionid=572e1f4258ca212116c2ea18de9ddee0&appletroot=" + object_url + "&appletlang=appletlang.xml&appletservers=servers069.xml&freeskin=appletskin.swf&appleturls=appleturls020.xml&appletstream=sharevideo_livejasmin009.swf&tipAnim=3.swf&nxt=exit_chat&performerid=TooHotJack&type=40&serverid=inner4q7opo85n9f0d5q7o4psli6e2712msv9&psid=awempire&pstour=t1&psprogram=REVS&pstool=&isad=true&livefeed=livefeed&issb=1&nodeid=HUBUD&memberip=109.71.162.34@583a56ac26afb30b952b3e0ea39bf66f&proxyip=109.71.162.193:8080&";

        function init() {
       开发者_如何学运维     document.getElementById('object_container').innerHTML = "<object width=\"710px\" height=\"284px\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"flash\"><param value=\"" + object_url + "memberchat001.swf\" name=\"movie\"><param value=\"high\" name=\"quality\"><param value=\"always\" name=\"AllowScriptAccess\"><param value=\"\" name=\"bgcolor\"><param value=\"" + param_url + "\" name=\"FlashVars\"><embed width=\"710px\" height=\"284px\" flashvars=\"" + param_url + "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" bgcolor=\"\" allowscriptaccess=\"always\" src=\"" + object_url + "memberchat001.swf\"></object>";
        }

        window.onload = init;

I call this script like this: I cannot edit the script cause it's from another server, an affiliate program. I can edit only the way i call it, which is displayed below:

<script type="text/javascript" language="javascript" src="http://test.com/fca/scripts.php?size=1&flags=1&appletcol=7A0000&txtcolor1=00CCFF&txtcolor2=FFCC00&txtcolor3=AAAAFF&txtcolor4=FFFFFF&txtcolor5=FF8484&txtcolor6=FFCC00&txtcolor7=FFCC00&txtcolor8=FFFFFF&txtcolor9=FFFFFF&txtcolor10=FFCC00&membcol=A180C5&guestcol=F06724&addcol1=850000&addcol2=7E0101&addcol3=E33335&addcol4=400000&addcol5=C10A09&addcol6=920000&addcol7=900000&psid=.....&psprogram=PPS&pstour=t1&campaign_id=32339&pstool=61_1&muteAudio=1&site=jsm"></script>

**<div id="object_container"></div>**


window.onload does not mean that the DOM is ready on all browsers. As you tagged your question jquery, replace it with

$(document).ready(function(){
    $('div#object_container').html('your string to set innerHTML');
});


The most likely problem is that there's no element on the page with the "id" value "object_container".


Maybe there is anything blocked by antivirus-software. If I take a short fragment out of the object_url and search for it on google there are a couple of results depending on malware: google: /flash/custom-freechat/


Is this code on a page with other code on it? The script may be overwriting window.onload after another script on your page does, and then another of the other script's event handlers may be failing because the necessary window.onload handler did not run. If that is the case, putting this script before the affiliate script would probably fix the page:

if(window.addEventListener) {
    window.onload && window.addEventListener('load', window.onload, false);
} else {
    window.onload && window.attachEvent('onload', window.onload);
}
window.onload = null;

Another possibility is that the init function conflicts in name with another script on the same page. If that's the case, there's no other option than loading the affiliate script in a separate document in an iframe (or fixing the other script that is on the page).


Webmasters ,

How come javascript scr has php

src="http://live-cams-1.livejasmin.com/fca/scripts.php?

can you fix this first.

and next do a null check on object_container.

0

精彩评论

暂无评论...
验证码 换一张
取 消