JavaScript code works in IE but not in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #16
    this is neither Java nor C/C++, it’s JavaScript (subtle but important difference).

    to apply logic, somewhere in your HTML you call that function, otherwise it wouldn’t be executed (and as far as I see it doesn’t have a parse error). I need to know that part.

    you could also provide a page, it would make it a bit easier for me.

    Comment

    • tweetz
      New Member
      • Jun 2010
      • 19

      #17
      Originally posted by Dormilich
      this is neither Java nor C/C++, it’s JavaScript (subtle but important difference).

      to apply logic, somewhere in your HTML you call that function, otherwise it wouldn’t be executed (and as far as I see it doesn’t have a parse error). I need to know that part.

      you could also provide a page, it would make it a bit easier for me.
      thank you so much ..I applied that fix(rng[0]) and it worked..

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #18
        that fix was obvious (for the expert).

        Comment

        • tweetz
          New Member
          • Jun 2010
          • 19

          #19
          Originally posted by Dormilich
          that fix was obvious (for the expert).
          I am new to this.So I am unaware of that.anyways thanks a lot.Can u help me in another error?

          Code:
          var is_browserName_IE = navigator.appName == "Microsoft Internet Explorer"? true : false;
          function editView_init(){
          	
          	
          	g_state = new _CState();
          	fixSizeTB();
          	if(!is_browserName_IE)
          		st = document.getElementById("myEditor").contentDocument;
          	else
          		st = frames.myEditor.document;
          	if (typeof testing == 'undefined') {
          		finalURL = "webcomposer/editor";
          	}
          	else {
          		if (testing) { // build testing url
          			finalURL = testURL;
          		}
          		else { // build production url
          			finalURL = prodURL;
          		}
          		
          	}
          	
          	if (isW3Mode) {
          		var strMethodName = "common.js::init()";
          		debugMsg(strMethodName);
          		if (typeof(window['template']) == "undefined") {
          			template = "";
          		}
          		if (template != null && template == 'w3_innovation') 
          			loadEditorCss("http://v25http104.mkm.can.ibm.com/innovation/wctCss/style.css");
          		
          		var ooDiaWin = document.createElement("DIV");
          		ooDiaWin.id = "diaWin";
          		ooDiaWin.className = "diaWinstyle";
          		document.body.appendChild(ooDiaWin);
          		checkLocation();
          		
          		
          		
          		if(!is_browserName_IE)
          		{
          		
          			addCSS(finalURL + "/css/screen.css");
          			addCSS(finalURL + "/css/interior.css");
          			addCSS(finalURL + "/css/icons.css");
          			addCSS(finalURL + "/css/tables.css");
          				
          		}
          		else
          		{
          			styleSheet = st.createStyleSheet();
          			styleSheet.addImport(finalURL + "/css/screen.css");
          			styleSheet.addImport(finalURL + "/css/interior.css");
          			styleSheet.addImport(finalURL + "/css/icons.css");
          			styleSheet.addImport(finalURL + "/css/tables.css");
          		}
          		
          		var oNode = st.createElement("div");
          		oNode.id = "content";
          		
          		if(!is_browserName_IE)
          		{
          			st.body.insertBefore(oNode,null);
          		}
          		else
          		{
          			st.body.insertBefore(oNode);
          		st.execCommand("2D-Position", true, true);
          		st.execCommand("MultipleSelection", true, true);
          		st.execCommand("LiveResize", true, true);
          		}
          		if(!is_browserName_IE)
          			var body = document.getElementById("myEditor").contentDocument.body;
          		else
          			var body = document.frames.myEditor.document.body;
          		body.className = "article";
          		
          		st = st.getElementById("content");
          		st.contentEditable = "True";
          		for (i = 0; i < document.all.length; i++) 
          			document.all(i).unselectable = "on";
          		OCode.unselectable = "off";
          		
          		// st.innerHTML=stdata;
          		st.innerHTML = stdata_v8;// + endOfLayout;
          		// remove terms of use.
          		removeTerms();
          		// set the attributes of this layout
          		setLayout(st);
          		// storePosition();
          		
          		if(!is_browserName_IE){
          			
          					
          			var ele=document.getElementById("myEditor").contentDocument.createRange();
          			//alert("selection--"+ele);
          			caretPos=ele;
          			//alert(caretPos);
          			prevPos=document.getElementById("myEditor").contentDocument.createRange();
          			//prevPos = document.getElementById("myEditor").contentDocument.getSelection();
          		}
          		else{
          			caretPos = document.frames["myEditor"].document.body.createTextRange();
          			prevPos = document.frames["myEditor"].document.body.createTextRange();
          		}
          		insertCaretPlaceholder();
          		if(!is_browserName_IE)
          			st = document.getElementById("myEditor").contentDocument.body;
          		else
          			st = document.frames.myEditor.document.body;
          		
          		setRange();
          		if(is_browserName_IE)
          		oRange.execCommand("Unselect", true, true);
          		if(!is_browserName_IE)
          			st = document.getElementById("myEditor").contentDocument.getElementById("content");
          		else
          			st = frames.myEditor.document.getElementById("content");
          		
          		debugMsg("PreProcessing");
          		if(!is_browserName_IE)
          			var oElemContentHead = document.getElementById("myEditor").contentDocument.getElementById("content-head");
          		else
          			var oElemContentHead = frames.myEditor.document.getElementById("content-head");
          		
          		if ((oElemContentHead != null) && (oElemContentHead.children.length > 0)) {
          			debugMsg(strMethodName + ":oElemContentHead != null and children > 0 ");
          			debugDumpChildrenList(oElemContentHead);
          			
          			AddAttributeLanguageToggle(oElemContentHead.firstChild);
          			
          			cleanupPlugin(oElemContentHead);
          			
          		}
          		else {
          		
          			debugMsg(strMethodName + "oElemContentHead is null or null or there are no children elem");
          			
          		}
          	}
          	else {
          		var ooDiaWin = document.createElement("DIV");
          		ooDiaWin.id = "diaWin";
          		ooDiaWin.className = "diaWinstyle";
          		document.body.appendChild(ooDiaWin);
          		st.createStyleSheet(finalURL + "/css/v16/all.css");
          		st.createStyleSheet(finalURL + "/css/v16/screen.css");
          		st.createStyleSheet(finalURL + "/css/v16/screen-uas.css");
          		st.createStyleSheet(finalURL + "/css/v16/handheld.css");
          		st.createStyleSheet(finalURL + "/css/v16/print.css");
          		st.createStyleSheet(finalURL + "/css/v16/screen-fonts.css");
          		
          		var oNode = st.createElement("div");
          		oNode.id = "Oedit";
          		st.body.insertBefore(oNode);
          		st.execCommand("2D-Position", true, true);
          		st.execCommand("MultipleSelection", true, true);
          		st.execCommand("LiveResize", true, true);
          		st = st.getElementById("Oedit");
          		st.contentEditable = "True";
          		for (i = 0; i < document.all.length; i++) 
          			document.all(i).unselectable = "on";
          		OCode.unselectable = "off";
          		st.innerHTML = stdata;
          		if(!is_browserName_IE)
          			st = document.getElementById("myEditor").contentDocument.body;
          		else
          			st = document.frames.myEditor.document.body;
          		setRange();
          		oRange.execCommand("Unselect", true, true);
          		
          		if(!is_browserName_IE){
          			caretPos = document.getElementById("myEditor").contentDocument.createTextRange();
          			prevPos = document.getElementById("myEditor").contentDocument.createTextRange();
          		}
          		else{
          			caretPos = document.frames["myEditor"].document.body.createTextRange();
          			prevPos = document.frames["myEditor"].document.body.createTextRange();
          		}
          		insertCaretPlaceholder();
          		
          		st = frames.myEditor.document.getElementById("Oedit");
          	}
          	
          	// event handlers
          	st.ondblclick = _Editor_DblClickHandler
          	st.onpaste = _Editor_PasteHandler
          	st.onmousedown = _Editor_ClickHandler
          	st.onmouseup = _Editor_MouseUpHandler
          	st.onkeydown = _Editor_KeyDownHandler
          	st.onkeyup = _Editor_KeyUpHandler
          	st.ondragstart = _Editor_DragStartHandler
          	st.ondrop = _Editor_DropHandler
          	st.oncontextmenu = _Editor_OnContextMenuHandler
          	st.ondeactivate = _Editor_OnDeactiveHandler
          	st.onbeforedeactivate = _Editor_OnBlurHandler
          	st.onselectstart = _Editor_OnSelectStartHandler
          	st.oncopy = _Editor_OnCopyHandler
          	st.oncut = _Editor_OnCutHandler
          	st.onclick = _StorePosition;
          	st.onselect = _StorePosition;
          	st.oncontrolselect = _ControlSelectHandler;
          	
          	params[0] = finalURL;
          	params[1] = isW3Mode;
          	
          	// @REDOUNDO
          	// Initializes the Redo/Undo feature:
          	initUndoRedo();
          	
          	//START: Fix for SIS site include page
          	var content = st.innerHTML;
          	if (content.match(/&lt;%=\w+%&gt;/gi)) {
          		content = content.replace(/<\s*div\s*id=ibm-pcon\s*>/i, "");
          		content = content.replace(/<\s*div\s*id=ibm-content\s*>/i, "");
          		content = content.replace(/<\/div>$/i, "");
          		content = content.replace(/<\/div>$/i, "");
          		st.innerHTML = content;
          	}
          	//END: Fix for SIS site include pages
          	
          	
          } // end function
          
          
          
          
          function init_loader() {
                window.onbeforeunload=beforeUnload;
              	if(isW3Mode){
              		document.getElementById("www_content_editor").parentElement.removeChild(document.getElementById("www_content_editor"));
              		document.getElementById("w3_content_editor").style.display="block";
              		stdata_v8=CELayout.innerHTML;
              		stdata="";
              		init();
              		checkLocation();
              		lib_bwcheck();
              	}else{
              		document.getElementById("w3_content_editor").parentElement.removeChild(document.getElementById("w3_content_editor"));
              		document.getElementById("www_content_editor").style.display="block";
              		stdata=CELayout.innerHTML;
              		stdata_v8="";
              		init();
              	}
          }
          
          function init_text_list() {
              	if(isW3Mode){
              		document.getElementById("www_text_list").parentElement.removeChild(document.getElementById("www_text_list"));
              		document.getElementById("w3_text_list").style.display="block";
                  	document.body.className = elements[3];
                  	resizeMe("240px", "440px");
              	}else{
              		document.getElementById("w3_text_list").parentElement.removeChild(document.getElementById("w3_text_list"));
              		document.getElementById("www_text_list").style.display="block";
              		resizeMe("327px", "265px");
                  	resizeBody(320);
              	}  
          }
          
          function init_image_data() {
            if(isW3Mode){
          		document.getElementById("www_image_data").parentElement.removeChild(document.getElementById("www_image_data"));
          		document.getElementById("w3_image_data").style.display="block";
              resizeMe("600px", "400px");
          	}else{
          		document.getElementById("w3_image_data").parentElement.removeChild(document.getElementById("w3_image_data"));
          		document.getElementById("www_image_data").style.display="block";
          	}
          }
          
          function init_link_data() {
            if(isW3Mode){
          		var mainbody = document.getElementsByTagName("body")[0];
          		mainbody.innerHTML = w3Content;
              document.body.className = elements[1];
          		resizeMe("550px", "400px");
          	}else{
          		var mainbody = document.getElementsByTagName("body")[0];
          		mainbody.innerHTML = wwwContent;
              resizeMe("375px", "510px");
          	}  
          
          }
          
          function init_edit_link_data() {
            if(isW3Mode){
          			var mainDiv = document.getElementById("mainDiv");
          			link = getLink();
          			var formStr = '<table border="1" cellspacing="0">\n' + '<tr><td colspan="4" id="message"></td></tr>\n';
          			formStr += generateLabelField() + '\n';
          			formStr += generateURLField() + '\n';
          			formStr += '</table>\n';
          			mainDiv.innerHTML = formStr;
          				
          		    if (isBookmarkLink()){
          			   document.getElementById('name').value = link.name;
          			}
          			else {
          				document.getElementById('url').value = link.href;
          		    	var text = "";
          				
          				if(link.getElementsByTagName("B")[0] != undefined)
          		    		text = link.getElementsByTagName("B")[0].getAdjacentText("afterBegin");
          		    	else if (link.getElementsByTagName("SPAN")[0] != undefined)
          		    	    text = link.getElementsByTagName("SPAN")[0].getAdjacentText("afterBegin");
          		    	else
          		    		text = link.getAdjacentText("afterBegin");
          				
          				document.getElementById('label').value = text;
          			}
          	}else{
          			var mainDiv = document.getElementById("mainDiv");
          			link = getLink();
          			parentType = link.parentNode.nodeName;
          			divBox = link.parentNode.parentNode.parentNode.className;
          			divBoxContent = link.parentNode.parentNode.parentNode.innerHTML; 			
          			className = link.className;
          			var formStr = '<table border="1" cellspacing="0">\n' + '<tr><td colspan="4" id="message"></td></tr>\n';
          			formStr += generateLabelField() + '\n';
          			formStr += generateURLField() + '\n';
          			
          			if (className.length > 0 && className != "ibm-feature-link" ){
          				// get the selected Icon index
          				for (i=0; i < icons.length; i++){
          					if (icons[i] == className){
          						selectedIcon = i;
          					}
          				}
          		
          				formStr += generateIconOptions() + '\n';			
          			}		
          				
          			formStr += '</table>\n';
          			mainDiv.innerHTML = formStr;
          				
          		    if (isBookmarkLink()){
          			   document.getElementById('name').value = link.name;
          			}
          			else {
          				document.getElementById('url').value = link.href;
          		    	var text = "";
          				
          				if(link.getElementsByTagName("B")[0] != undefined)
          		    		text = link.getElementsByTagName("B")[0].getAdjacentText("afterBegin");
          		    	else if (link.getElementsByTagName("SPAN")[0] != undefined)
          		    	    text = link.getElementsByTagName("SPAN")[0].getAdjacentText("afterBegin");
          		    	else
          		    		text = link.getAdjacentText("afterBegin");
          		    		
                    if(divBox != null && (divBox=="ibm-container-body" )){
                      text = link.innerHTML;		    		
          		    		text1 = text.split("<BR>");
          		    		var text2="";
          		    		for(var i = 0; i < text1.length; i++){
                        text2 = text2 + text1[i];
                      }            
                      text = text2;        
                    }	
          				  document.getElementById('label').value = text;
          			}
          	}  
          
          }
          
          function init_table_data() {
            
            if (isW3Mode) 
           {
            	//alert("in ifff");
          	if (!is_browserName_IE) 
            		document.getElementById("www_table_data").parentNode.removeChild(document.getElementById("www_table_data"));
            	else 
            		document.getElementById("www_table_data").parentElement.removeChild(document.getElementById("www_table_data"));
            		document.getElementById("w3_table_data").style.display = "block";
            		//alert(tableInfo[0]);
          	if (!is_browserName_IE){}
          		 //location=location;
          	else
          		location = tableInfo[0];
          	//alert(location);
          	//alert(tableInfo[1]);
            	document.body.className = tableInfo[1];
          	//alert(document.body.className);
            	resizeMe("500px", "600px");
          	//alert("in if");
           }
           else {
            
            	alert("hi in else");
            	if (!is_browserName_IE) 
            		document.getElementById("w3_table_data").parentNode.removeChild(document.getElementById("w3_table_data"));
            	else 
            		document.getElementById("w3_table_data").parentElement.removeChild(document.getElementById("w3_table_data"));
            	document.getElementById("www_table_data").style.display = "block";
            	resizeMe("550px", "550px");
            	// debugMsg(PACKAGE_NAME + "init()\n\tm_param_columnwidth="+
          			// m_param_columnwidth);
          			var strDisplayHTMLTable = null;
          			var regExp = null;
          			
          			for (i = 0; i < dataTableNames.length; i++) {
          				regExp = / @@TABLE_WIDTH@@ /g;
          				strDisplayHTMLTable = dataTableCodes[i].replace(regExp, DISPLAY_WIDTH);
          				regExp = / @@HEADER@@ /g;
          				strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_HEADER);
          				regExp = / @@DATA@@ /g;
          				strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_DATA);
          				
          				if (i == 0) {
          					regExp = / @@TABLE_HEADER@@ /g;
          					strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_TABLE_CAPTION_DATA);
          				}
          				else 
          					if (i == 1) {
          						regExp = / @@TABLE_HEADER@@ /g;
          						strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_TABLE_CAPTION_COMPLEX);
          					}
          					else {
          						alert(PACKAGE_NAME + "init()\n\t" + ERR_1745);
          					} // end if
          				debugMsg(strDisplayHTMLTable);
          				
          				if (strDisplayHTMLTable != null) {
          					row = textList.insertRow()
          					td = row.insertCell()
          					td.insertAdjacentHTML("afterBegin", "<br /><a onclick=\"selectText(\'" + i + "\');\">" + strDisplayHTMLTable + "</a><br />");
          				}
          				strDisplayHTMLTable = null;
          				regExp = null;
          			} // end for
          			resizeBody(530);
          		}
          
          }
          
          function init_component_data() {
            if(isW3Mode){
          		var mainbody = document.getElementsByTagName("body")[0];
          		mainbody.innerHTML = w3Content;    
              location = para[0];
          		document.body.className = para[1];
          		// show breadcrumbs only when the cursor is at content-head
          		if(location=="content-head"){
          			// show Page Tabs and Page Toggles
          			var oOption1=document.createElement("OPTION");
          			oOption1.value=3;
          			oOption1.innerHTML='&nbsp\;Page Level Tabs&nbsp\;';
          			document.text.type.appendChild(oOption1);
          			var oOption2=document.createElement("OPTION");
          			oOption2.value=5;
          			oOption2.innerHTML='&nbsp\;Page Toggles&nbsp\;';
          			document.text.type.appendChild(oOption2);
          			// show breadcrumbs
          			var oOption=document.createElement("OPTION");
          			oOption.value=4;
          			oOption.innerHTML='&nbsp\;Breadcrumbs&nbsp\;';
          			document.text.type.appendChild(oOption);
          		}
          
          		if(location=="content-main") {
          			// show Page Tabs and Page Toggles
          			var oOption1=document.createElement("OPTION");
          			oOption1.value=3;
          			oOption1.innerHTML='&nbsp\;Page Level Tabs&nbsp\;';
          			document.text.type.appendChild(oOption1);
          			var oOption2=document.createElement("OPTION");
          			oOption2.value=5;
          			oOption2.innerHTML='&nbsp\;Page Toggles&nbsp\;';
          			document.text.type.appendChild(oOption2);
          		}
          		document.text.type.focus();
          		document.text.type.selectedIndex = 0;
              generateText();
          
          	}else{
          	  // alert("www mode from rules engine");
          	  // alert("going to resize");
          	  resizeMe("570px", "700px");
          		var mainbody = document.getElementsByTagName("body")[0];
          		mainbody.innerHTML = wwwContent;
          		/*
          		 * var div = document.createElement('div'); div.id =
          		 * "www_component_data"; div.innerHTML = www; mainbody.appendChild(div);
          		 */
          		
          
          		if(displayMode == "content" || displayMode == "ibm-content-main"){
          			document.getElementById("main_column_components").style.display = "";
          		}else if(displayMode == "ibm-content-sidebar"){
          			document.getElementById("sidebar_components").style.display = "";
          		}else if(displayMode == "content-3-1" || displayMode == "content-3-2"){
          			document.getElementById("content3_components").style.display = ""
          		}else if(displayMode == "content-4-1" || displayMode == "content-4-2" || displayMode == "content-4-3"){
          			document.getElementById("content4_components").style.display = ""
          		}else if(displayMode == "ibm-content-head"){
          			document.getElementById("ibm-content-head").style.display = ""
          		}
          		else{// must be popup layout
          			document.getElementById("miscellaneous_components").style.display = "";
          		}
          
          		window.focus();    
              resizeBody(545);
              initDropDown();
          	} 
          }
          
          function init_plugin_data() {
            if(isW3Mode){
          		document.getElementById("www_plugin_data").parentElement.removeChild(document.getElementById("www_plugin_data"));
          		document.getElementById("w3_plugin_data").style.display="block";
          		resizeMe("650px", "400px");
          		// displayCustomizedComponents();
          		generateMainPluginTable();
          		// displayCustomComponents();
          		if(isSiteServ()) {
          			generateSiteServPluginTable();
          		}
          		if(isDynamicTrue) {
          			resizeMe("850px", "525px");
          			// generateChsPluginTable();
          		}
          
          	}else{
          		document.getElementById("w3_plugin_data").parentElement.removeChild(document.getElementById("w3_plugin_data"));
          		document.getElementById("www_plugin_data").style.display="block";
          		resizeMe("650px", "470px");
          		// displayCustomizedComponents();
              generatePluginTable();
          	}
          }
          
          function getElementOf(parent, childName, attributeName, attributeValue, getFirstFound){
            var targetElement = null;
            var children = parent.all;
            for(var i=0; i<children.length; i++){
              var child = children(i);
              if(child.nodeType == 1 && child.tagName == childName){
          	  if(attributeName == ''){
          	    return child;
          	  }else{
          	    var att = child.getAttributeNode(attributeName);
          	    if(att != null && att.nodeValue == attributeValue){
          		  targetElement =  child;
          		  if(getFirstFound){
          	        return targetElement;
          		  }
          	    }
          	  }
          	}
            }
            return targetElement;
          }
          
          
          // search for an element among all elements contained in parent
          // function hasChildOf() only search one level
          function hasElementOf(parent, childName, attributeName, attributeValue){
            var children = parent.all;
            for(var i=0; i<children.length; i++){
              var child = children(i);
              if(child.nodeType == 1 && child.tagName == childName){
          	  if(attributeName == ""){
          	    return true;
          	  }
          	  var att = child.getAttributeNode(attributeName);
          	  if(att != null && att.nodeValue == attributeValue){
          	    return true;
          	  }
          	}
            }
            return false;
          }
          
          function raiseButton(el) {with (el.style) {borderTop ="1 solid buttonhighlight";borderLeft ="1 solid buttonhighlight";
                  borderBottom ="1 solid buttonshadow";borderRight ="1 solid buttonshadow";padding ="1";}}
          
          function normalButton(el) {with (el.style) {background = "";border = "1px solid buttonface";padding = "1";}}
          
          function pressedButton(el) {with (el.style){ borderTop ="1 solid buttonshadow";paddingTop = "2";borderLeft ="1 solid buttonshadow";
                  borderBottom ="1 solid buttonhighlight";paddingBottom= "0";borderRight = "1 solid buttonhighlight";}}
          
          function getReal(evt, type, value) {  
          	if (!evt) evt = window.event;
          	temp = evt;
              while ((temp != null) && (temp.tagName != "BODY")) 
              {  
          	    if (eval("temp." + type) == value) 
          	    {
          	    	evt = temp;return evt;
          	    }
          		if(!is_browserName_IE)
          			temp = temp.parentNode     
                  else
                     temp = temp.parentElement;
                  
                  
               }
               return evt;
               
           }
          
          
          
          function setRange()
          {
          	if(!is_browserName_IE)
          	{
          		st = document.getElementById("myEditor").contentDocument;
          		oSelect = st.getSelection();
          		
          		oTop=oSelect.toString().length+st.body.scrollTop;
          		oLeft=oSelect.toString().length+st.body.scrollLeft;
          		
          		
          	}
          	else
          	{
          	    st=document.frames["myEditor"].document;
          		oSelect = st.selection;
          		oRange=oSelect.createRange();
          		oTop=oRange.offsetTop+st.body.scrollTop;
          		oLeft=oRange.offsetLeft+st.body.scrollLeft;
          	}
          }
          
          function parentHasID_Of(idValue, childElement){
            if(childElement != null){
              var parent = childElement.parentElement;
          	if(parent != null){
          	  if(parent.id.indexOf(idValue)!=-1){
          	    return true
          	  }else{
          	    return parentHasID_Of(idValue, parent);
          	  }
          	}  
            }
            return false;
          }
          
          /**
           * Position Context Menu
           */
          function positionMenu(contextMenu, curposX, curposY, halfScreenWidth, halfScreenHeight) {	
          	
          	// Screen Quadrant
          	// |
          	// 2nd | 1st
          	// -------------------------
          	// |
          	// 3rd | 4th
          	
          	// check if mouse cursor is at first quadrant of the screen
          
          	if (curposX > halfScreenWidth && curposY < halfScreenHeight) {
          		debugMsg("first quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
          		contextMenu.style.leftPos+=10;
          		contextMenu.style.posLeft=ev.clientX+50;
              contextMenu.style.posTop=ev.clientY;
              if(isW3Mode){
          	     contextMenu.style.posTop += 100;
              }
              contextMenu.style.display="";
          		contextMenu.setCapture();	
          	}
          	// check if mouse cursor is at second quadrant of the screen
          	else if (curposX < halfScreenWidth && curposY < halfScreenHeight) {
          		debugMsg("second quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
          		contextMenu.style.leftPos+=10;
          		contextMenu.style.posLeft=ev.clientX+200;
          		contextMenu.style.posTop=ev.clientY;
          		if(isW3Mode){
          	     contextMenu.style.posTop += 100;
              }
          		contextMenu.style.display="";
          		contextMenu.setCapture();	
          	}
          	// check if mouse cursor is at 3rd quadrant of the screen
          	else if (curposX < halfScreenWidth && curposY > halfScreenHeight) {
          		debugMsg("thrid quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
          		contextMenu.style.leftPos+=10;
          		contextMenu.style.posLeft=ev.clientX+200;
          		contextMenu.style.posTop=ev.clientY-120;
          		contextMenu.style.display="";
          		contextMenu.setCapture();	
          	}
          	// check if mouse cursor is at 3rd quadrant of the screen
          	else if (curposX > halfScreenWidth && curposY > halfScreenHeight) {
          		debugMsg("fourth quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
          		contextMenu.style.leftPos+=10;
          		contextMenu.style.posLeft=ev.clientX+50;
          		contextMenu.style.posTop=ev.clientY-120;
          		contextMenu.style.display="";
          		contextMenu.setCapture();	
          	}
          }
          
          function validateURL(fieldObj)
          {
          	var value = fieldObj.value;
          	if (!isAlphaNumericSpecial(value, false)) {
          		// alert("The URL can only contain letters, digits, periods, colons,
          		// slashes, question marks, pound signs, ampersands, hyphens,
          		// underscores, at signs, plus signs, equal signs, percentage signs,
          		// semi-colons, brackets, tilters, or commas.");
          		alert(msg112);
          		return false;
          	}
          	else {
          		return true;
          	}
          }
          
          function isAlphaNumericSpecial (s,defaultEmptyOK)
          {
              if (isEmpty(s)) {
          		// if the user set Empty is okay, return
          		if (defaultEmptyOK == true)
          			return true;
          		// Otherwise, false
          		else
          			return false;
              }
          
              // Search through string's characters one by one
              // until we find a non-alphanumeric character.
              // When we do, return false; if we don't, return true.
              for (var i = 0; i < s.length; i++)
              {
                  // Check that current character is number or letter.
                  var c = s.charAt(i);
                  if (!(isLetter(c) || isDigit(c)))
                  {
          			if((c==".") || (c==":") || (c=="/") || (c=="?") || (c=="#") || (c=="&") || (c=="-") || (c=="_") || (c=="@") || (c=="+") || (c=="=") || (c=="%") || (c==";") || (c=="(") || (c==")") || (c=="~") || (c==",")) // these
          																																																							// characters
          																																																							// are
          																																																							// OK
          				continue;
          			else
          				return false;
          		}
              }
          
              // All characters are numbers or letters.
              return true;
          }
          
          
          function isEmpty(s)
          {
          	return ((s == null) || (s.length == 0));
          }
          
          // Returns true if character c is an English letter (A .. Z, a..z).
          function isLetter (c)
          {
          	return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) );
          }
          
          // Returns true if character c is a digit (0 .. 9).
          function isDigit (c)
          {
          	return ((c >= "0") && (c <= "9"));
          }
          
          // find the first occurance of TD tag
          function findTD(el) {
          	var tempElem=el;
          	while(tempElem!=null) {		
          		if(tempElem.tagName=="TD") {
          			return tempElem;
          		}
          		else if (tempElem.tagName=="TH") {
          			return tempElem;
          		}
          		else {
          			// do nothing
          		}
          		
          		// otherwise search the parent element
          		tempElem=tempElem.parentElement;	
          		
          		// return when it reaches the top of the code
          		if(tempElem.tagName=="HTML") {
          			return el;
          		}		
          		
          	}
          	
          	
          	return tempElem;	
          }
          
          function fixTBpos()
          { 
          
          var OCode = document.getElementById('OCode');
          
          var ODiv  = document.getElementById('ODiv');
          
              st=document.body;
          	if(isW3Mode)
          	    OCode.style.height=ODiv.style.height=st.clientHeight-119;
          	else
                  OCode.style.height=ODiv.style.height=st.clientHeight-113;
          
              typeof(toc) == "undefined" ? '':Resizetoc();
          }
          
          function hasTagsInText(text)
          {
          	
          	if(text.indexOf("<TABLE") >=0 || text.indexOf("<table") >=0)
                  return 'table';
                  
              if(text.indexOf("<TD") >=0 || text.indexOf("<td") >=0)
                  return 'column';	
                  
              if(text.indexOf("<IMG") >=0 || text.indexOf("<img") >=0)
                  return 'image';
              
          	if(text.indexOf("<H2") >=0 || text.indexOf("<h2") >=0)
                  return 'h2';
          		       
              if(text.indexOf("<DIV") >=0 || text.indexOf("<div") >=0)
                  return 'div';
                      
          	if(text.indexOf("<A") >=0 || text.indexOf("<a") >=0)
                  return 'link';   
          		
              if(text.indexOf("<FORM") >=0 || text.indexOf("<form") >=0)
                  return 'form';
          		
          	if(text.indexOf("<P>") >=0 || text.indexOf("<p>") >=0)
                  return 'invisible paragraph-mark';
          		
              if(text.indexOf("<BR>") >=0 || text.indexOf("<br>") >=0)
                  return 'invisible new-line-mark';
          
          	return '';
          }
          
          function hasFormatInText(text)
          {
          	var format = ''
          	if(text.indexOf("id=subtitle") >=0)
                  format+= 'id=subtitle'	
          		
          	if(text.indexOf("class=greytext") >=0)
                  format+= 'class=greytext'	
          	if(text.indexOf("class=prices") >=0)
                  format+= 'class=prices'	
          	if(text.indexOf("class=small") >=0)
                  format+= 'class=small'	
          	if(text.indexOf("class=bct") >=0)
                  format+= 'class=bct'	
                  
          // jae added
          	if(text.indexOf("class=price") >=0)
          	format+= 'class=price'
          	
          	if(text.indexOf("class=error") >=0)
          	format+= 'class=error'
          // to here
          
          	if(text.indexOf("<BLOCKQUOTE ") >=0 || text.indexOf("<BLOCKQUOTE>") >=0)
                  format+= 'header=blockquote'		
          	
          		
          	if(text.indexOf("formatted-text") >=0 || text.indexOf("class=")>=0)
                  format+= 'id=misctext'	
          
          	if(text.indexOf("<SPAN ") >=0 || text.indexOf("<SPAN>") >=0)
                  format+= 'span'
          	
          	if(text.indexOf("<H1 ") >=0 || text.indexOf("<H1>") >=0)
                  format+= 'header=h1'
          	
          	if(text.indexOf("<H2 ") >=0 || text.indexOf("<H2>") >=0)
                  format+= 'header=h2'
                  
              if(text.indexOf("<H3 ") >=0 || text.indexOf("<H3>") >=0)
                  format+= 'header=h1'
          	
          	if(text.indexOf("<H4 ") >=0 || text.indexOf("<H4>") >=0)
                  format+= 'header=h2'    
          	
          	if(text.indexOf("<EM ") >=0 || text.indexOf("<EM>") >=0)
                  format+= 'style=em'
          	
          	if(text.indexOf("<B ") >=0 || text.indexOf("<B>") >=0)
                  format+= 'style=b'
          	if(text.indexOf("<STRONG ") >=0 || text.indexOf("<STRONG>") >=0)
                  format+= 'style=strong'
          	if(text.indexOf("<I ") >=0 || text.indexOf("<I>") >=0)
                  format+= 'style=i'
          	
          	if(text.indexOf("<U ") >=0 || text.indexOf("<U>") >=0)
                  format+= 'style=u'
          	if(text.indexOf("<FONT ") >=0 || text.indexOf("<FONT>") >=0)
                  format+= 'style=font'	
          		
          	return format	 
          }

          Comment

          • tweetz
            New Member
            • Jun 2010
            • 19

            #20
            Please help me in that text undefined error....Becaus e I cannot get a better and polite expert like u

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #21
              I need to see the relevant HTML (which contains the function call) or a working link to the page.

              Comment

              • tweetz
                New Member
                • Jun 2010
                • 19

                #22
                Originally posted by Dormilich
                I need to see the relevant HTML (which contains the function call) or a working link to the page.
                Actually When I apply that fix I am getting many errors like doUp is not defined doDown doOver doOut not defined..Its all in one line

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #23
                  those may have the same reasons.

                  Comment

                  • tweetz
                    New Member
                    • Jun 2010
                    • 19

                    #24
                    Originally posted by Dormilich
                    those may have the same reasons.
                    I have all those errors in this single line..how 2 fix this?
                    Last edited by Dormilich; Jun 3 '10, 02:28 PM. Reason: removed insufficient code

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #25
                      I don’t know without code.

                      Comment

                      • tweetz
                        New Member
                        • Jun 2010
                        • 19

                        #26
                        Originally posted by Dormilich
                        I don’t know without code.
                        how to fire the errors using firebug in firefox?

                        Comment

                        • Dormilich
                          Recognized Expert Expert
                          • Aug 2008
                          • 8694

                          #27
                          that question does not make sense to me. please explain.

                          Comment

                          • tweetz
                            New Member
                            • Jun 2010
                            • 19

                            #28
                            Originally posted by Dormilich
                            that question does not make sense to me. please explain.
                            Actually I installed firebug add-on in firefox,how to work with that..Showing the same error text undefined

                            Comment

                            • Dormilich
                              Recognized Expert Expert
                              • Aug 2008
                              • 8694

                              #29
                              that’s what Firebug does (among others). I think there’s a tutorial at the Firebug website about how to use it.

                              I only can help you further if I can see your page.

                              Comment

                              • tweetz
                                New Member
                                • Jun 2010
                                • 19

                                #30
                                Originally posted by Dormilich
                                that’s what Firebug does (among others). I think there’s a tutorial at the Firebug website about how to use it.

                                I only can help you further if I can see your page.
                                Code:
                                tml><head><title><%= zget("/user/url")%></title>
                                <script type="text/javaScript" src="content_editor/js/scripts.js"></script>
                                
                                <link rel="stylesheet" type="text/css" href="content_editor/css/editorcss/v4-screen.css" />
                                <style type="text/css" media="all">
                                <!--
                                @import url("content_editor/css/editorcss/screen.css");
                                @import url("content_editor/css/editorcss/interior.css");
                                @import url("content_editor/css/editorcss/icons.css");
                                -->
                                </style>
                                <script type="text/javaScript"> 
                                var wct_version = 6.0;
                                var isW3Mode = <%= zget("/user/isW3Mode")%>;
                                var is_browserName_IE = navigator.appName == "Microsoft Internet Explorer"? true : false;
                                
                                <% String content = zget("/user/SELECTEDPAGEDATA");
                                	content = content.replace("&apos;","\'");
                                	String w3Content = "";
                                	String wwwContent = "";
                                	 if(zget("/user/isW3Mode")){
                                	 	w3Content = content;
                                	 }else{
                                	 	wwwContent = content;
                                	 }
                                %>
                                </script>
                                
                                <!-- print stylesheet MUST follow imported stylesheets -->
                                <link rel="stylesheet" type="text/css" media="print" href="content_editor/css/editorcss/print.css" />
                                <script type="text/javaScript"  src="content_editor/js/buildurl.js" ></script>
                                <script type="text/javascript" language="JavaScript" id="tagURL" src="content_editor/js/css.js"></script>
                                <script type="text/javaScript"  src="content_editor/config/config.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/static-messages.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/events.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/common.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/common_utils.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/common_menu.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/content_menu.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/context_menu.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/rules_engine.js" ></script>
                                <script type="text/javaScript"  src="content_editor/js/PluginService.js" charset="iso-8859-1"></script>
                                <script type="text/javaScript"  src="content_editor/js/editview.js" ></script>
                                <script type="text/javascript" src="/js/upload.js"></script>
                                <script type="text/javascript" src="/js/ajax.js"></script>
                                <script type="text/javascript" src="/js/popuplauncher.js"></script>
                                <script type="text/javascript" src="/js/shared.js"></script>
                                
                                <link rel="stylesheet" href="content_editor/css/r1.css" type="text/css"/>
                                </head>
                                
                                
                                <body bgcolor="white" style="margin: 0; border: 0" onload="init_loader()"  >
                                <div id="loadingMsg" align="center" style="display:none"><strong>Loading...Please wait</strong></div>
                                <DIV id="www_content_editor" style = "display : none;" >
                                	<form name="form0" action="" method="post" target="_top"></form>
                                		<div id="header" style="position:absolute;top:43;left:0;height:100%;width:100%;">
                                			<img id="tagURL" src="content_editor/media/v16_header.jpg" width="930" height="80" border="0" alt="v16_header.jpg">
                                		</div>
                                		<div id="navbar" style="text-align:left;position:absolute;top:115;left:0;height:184;width:389;">
                                			<img id="tagURL" src="content_editor/media/v16_left_nav.gif" width="184" height="389" border="0" alt="v16_left_nav.gif">
                                		</div>
                                		<div id="ODiv" style="position:absolute;top:115;left:149;width:780;height:600;border:1px inset black">
                                			<iframe id="myEditor"width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0" scrolling="yes" style="display:''">
                                			</iframe>
                                			<textarea id="OCode" style="border:none;font-size:8pt;width:100%;height:100%;display:'none'">
                                			</textarea>
                                		</div>
                                		<div id="CELayout" style="display:none;"><%= wwwContent%></div>
                                </div>
                                
                                <DIV id="w3_content_editor" style = "display : none" >
                                
                                		<form name="form0" action="" method="post" target="_top"></form>
                                		<!-- TO-DO -->
                                		<!-- To enable Shortcut menu bar, plese set "top:42" for <div id=header> -->
                                		<div id ="header" style="background:#FFFFFF;position:absolute;top:43;left:0;height:100%;width:100%;">
                                		<!-- start popup masthead //////////////////////////////////////////// -->
                                		<div id="popup-masthead" style="display:none">
                                			<img id="popup-w3-sitemark" src="content_editor/media/id-w3-sitemark-small.gif" alt="" width="182" height="26" />
                                		</div>
                                		<!-- stop popup masthead //////////////////////////////////////////// -->
                                		<!-- start masthead -->
                                
                                		<div id="masthead" UNSELECTABLE="on">
                                			<h2 class="access">Start of masthead</h2>
                                			<div id="prt-w3-sitemark"><img src="content_editor/media/id-w3-sitemark-simple.gif" alt="" width="54" height="33" /></div>
                                			<div id="prt-logo"><img src="content_editor/media/id-logo-black.gif" alt="Logo" width="44" height="15" /></div>
                                			<div id="w3-sitemark"><img src="content_editor/media/id-w3-sitemark-large.gif" alt="" width="266" height="70" usemap="#sitemark_map" /><map id="sitemark_map" name="sitemark_map"><area shape="rect" alt="Link to W3 Home Page" coords="0,0,130,70" accesskey="1" /></map></div>
                                			<div id="site-title-only">WebComposer Content Editor</div>
                                			<div id="logo"><img src="content_editor/media/id-logo.gif" alt="Logo" width="44" height="15" /></div>
                                			<div id="persistent-nav"><a id="w3home" href="http://w3.com/"> w3 Home </a><a id="bluepages"> BluePages </a><a id="helpnow"> HelpNow </a><a id="feedback" href="http://w3.com/feedback/" accesskey="9"> Feedback </a></div>
                                			<div id="header-search">
                                				<form action="" method="get" id="search">
                                				<table cellspacing="0" cellpadding="0" class="header-search">
                                				<tr><td class="label"><label for="header-search-field">Search w3</label></td><td class="field"><input id="header-search-field" name="qt" type="text" accesskey="4" disabled/></td><td class="submit"><input id="header-search-btn" type="image" alt="Go" src="content_editor/media/btn-go-dark.gif" disabled/></td></tr>
                                				</table>
                                				</form>
                                			</div>
                                			<div id="browser-warning"><img src="content_editor/media/icon-system-status-alert.gif" alt="Error" width="12" height="10" /> This Web page is best used in a modern browser. Since your browser is no longer supported by , please upgrade your web browser at the <a href="http://w3.com/download/">ISSI site</a>.</div>
                                		</div>
                                		<!-- stop masthead -->
                                		</div>
                                		<!-- TO-DO -->
                                		<!-- To enable Shortcut menu bar, plese set "top:42" for <div id=navbar> -->
                                		<div id ="navbar" style="position:absolute;top:43;left:0;height:445;width:1;border:1">
                                		<!-- start navigation -->
                                		<div id="navigation">
                                			<h2 class="access">Start of left navigation</h2>
                                			<!-- left nav -->
                                			<div id="left-nav">
                                				<img src="content_editor/media/w3v8_navbar.jpg" width="142" height="393" border="0">
                                			</div>
                                		</div>
                                		<!-- stop navigation -->
                                		</div>
                                		<div id="ODiv" style="position:absolute;top:115;left:50;height:100%;border:1px inset black">
                                		    <iframe width=100% height=100% frameborder=0 scrolling="yes" ID=myEditor style="display:''"></iframe>
                                		    <textArea id=OCode style="border:none;font-size:8pt;width:100%;height:100%;display:'none'" rows="1" cols="20"></textarea>
                                		</div>
                                		<!-- For display in Content Editor -->
                                		<div id="CELayout" style="display:none"><%= w3Content%></div>
                                
                                </div>
                                <script type="text/javascript">
                                writemenus();
                                <!-- For removing plugin code from Content Editor and keep placeholder images -->
                                new PluginService ().removePluginCode(document.getElementById("CELayout"));
                                </script>
                                </body></html>

                                Comment

                                Working...