Search Results

Search found 6 results on 1 pages for 'dkris'.

Page 1/1 | 1 

  • TinyMCE include crashes IE8

    - by dkris
    I am trying to open a popup onclick using a function call as shown below. <a id="forgotPasswordLink" href="#" onclick="openSupportPage(document.getElementById('forgotPasswordLink').innerHTML);"> Some Text </a> I am creating the HTML for the pop up page on the fly and also including the TinyMCE source file over there. The code is as shown below: <script type="text/javascript"> <!-- function openSupportPage(unsafeSupportText) { var features="width=700,height=400,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes"; var winId=window.open('','Test',features); winId.focus(); winId.document.open('text/html','replace'); winId.document.write('<html><head><title>' + document.title + '</title><link rel="stylesheet" href="./css/default.css" type="text/css">\n'); winId.document.write('<script src="./js/tiny_mce/tiny_mce.js" type="text/javascript" language="javascript">Script_1</script>\n'); winId.document.write('<script src="./js/support_page.js" type="text/javascript" language="javascript">Script_2</script>\n'); winId.document.write('</head><body onload="inittextarea()">\n');/*function call which will use the TinyMCE source file*/ winId.document.write(' \n'); winId.document.write('<p>&#160;</p>'); var hiddenFrameHTML = document.getElementById("HiddenFrame").innerHTML; hiddenFrameHTML = hiddenFrameHTML.replace(/&amp;/gi, "&"); hiddenFrameHTML = hiddenFrameHTML.replace(/&lt;/gi, "<"); hiddenFrameHTML = hiddenFrameHTML.replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML); winId.document.write('<textarea id="content" rows="10" style="width:100%">\n'); winId.document.write(document.getElementById(top.document.forms[0].id + ":supportStuff").innerHTML); winId.document.write('</textArea>\n'); var hiddenFrameHTML2 = document.getElementById("HiddenFrame2").innerHTML; hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&amp;/gi, "&").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML2); winId.document.write('</body></html>\n'); winId.document.close(); } // --> </script> The support.js file contains the following. function inittextarea() { tinyMCE.init({ elements : "content", mode : "exact", theme : "advanced", readonly : true, setup : function(ed) { ed.onInit.add(function() { tinyMCE.activeEditor.execCommand("mceToggleVisualAid"); }); } }); } The problem arises when the onclick event is fired and the pop up opens up, IE8 stops responding and seems to hang. It is working fine on Chrome, Firefox and Safari. I feel that the issue is because of TinyMCE script inclusion because on commenting the lines that include the tiny_mce.js and the support_page.js, the popup renders with no issues. I am also using the latest TinyMCE release. Please let me know why this is happening and what could be the resolution.

    Read the article

  • Date and Time Conversion in Ruby

    - by dkris
    I am currently looking on converting Thu Jun 10 16:17:55 +0530 2010 to 15/06/2010 or 15-06-2010 using Ruby I am getting the dates from the DB as shown below. @tickets = Ticket.find(:all) for ticket in @tickets print ticket.created_at end I have been looking around for resources as I a n00b in RoR/Ruby. I have looked at Class Date Class DateTime and couldn't make much of it. Please let me know how I could achieve this conversion in Ruby.

    Read the article

  • JavaScript source file not loading in IE8 Popup

    - by dkris
    I have an issue where the JavaScript source file is loading in popup for IE6, Chrome, Firefox, Safari and Opera. But the same source file is not loading up in IE8. As a result of this the HTML is not being replaced in the Popup and I am getting an error in IE8 popup saying tinyMCE is not defined I have referred to http://stackoverflow.com/questions/2949234/formatting-this-javascript-line and solved issue on all browsers except IE8. The JavaScript function is as follows: function openSupportPage() { var features="width=700,height=400,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes"; var winId=window.open('','',features); winId.document.open(); winId.document.write('<html><head><title>' + document.title + '</title><link rel="stylesheet" href="../css/default.css" type="text/css">\n'); var winDoc = winId.document; var sEl = winDoc.createElement("script"); sEl.src = "../js/tiny_mce/tiny_mce.js";/*TinyMCE source file*/ sEl.type="text/javascript"; winDoc.getElementsByTagName("head")[0].appendChild(sEl); winId.document.write('<script type="text/javascript">\n'); winId.document.write('function inittextarea() {\n'); winId.document.write('tinyMCE.init({ \n'); winId.document.write('elements : "content",\n'); winId.document.write('theme : "advanced",\n'); winId.document.write('readonly : true,\n'); winId.document.write('mode : "exact",\n'); winId.document.write('theme : "advanced",\n'); winId.document.write('readonly : true,\n'); winId.document.write('setup : function(ed) {\n'); winId.document.write('ed.onInit.add(function() {\n'); winId.document.write('tinyMCE.activeEditor.execCommand("mceToggleVisualAid");\n'); winId.document.write('});\n'); winId.document.write('}\n'); winId.document.write('});}</script>\n'); window.setTimeout(function () {/*using setTimeout to wait for the JS source file to load*/ winId.document.write('</head><body onload="inittextarea()">\n'); winId.document.write(' \n'); var hiddenFrameHTML = document.getElementById("HiddenFrame").innerHTML; hiddenFrameHTML = hiddenFrameHTML.replace(/&amp;/gi, "&"); hiddenFrameHTML = hiddenFrameHTML.replace(/&lt;/gi, "<"); hiddenFrameHTML = hiddenFrameHTML.replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML); winId.document.write('<textarea id="content" rows="10" style="width:100%">\n'); winId.document.write(document.getElementById(top.document.forms[0].id + ":supportStuff").innerHTML); winId.document.write('</textArea>\n'); var hiddenFrameHTML2 = document.getElementById("HiddenFrame2").innerHTML; hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&amp;/gi, "&"); hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&lt;/gi, "<"); hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML2); winId.document.write('</body></html>\n'); winId.document.close(); }, 300); } Additional Information: Screen shot of the page Rendered HTML Original JSPF please help me with this one.

    Read the article

  • IE8 Crashes Strangely on JavaScript Popup

    - by dkris
    Hi, I am facing a strange issue after the popup is created onclick. The popup opens up but hangs immediately on IE8 (works fine on all the other browsers including IE6). But on adding the alertbox as show in the JavaScript code, the popup works fine. I am using **https** and not **http** and i feel popup is not able to load the JS file because of SSL. Here is the how i am generating the onclick event: <a id="forgotPasswordLink" href="#" onclick="openSupportPage();"> Some Text </a> The onclick function is defined this way: function openSupportPage() { var features = "width=700,height=400,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes"; var winId = window.open('', '', features); winId.focus(); winId.document.open(); winId.document.write('<html><head><title>' + document.title + '</title><link rel="stylesheet" href="./css/default.css" type="text/css">\n'); var is_ie6 = ( window.external && typeof window.XMLHttpRequest == "undefined"); alert(is_ie6);/*The JS include below*/ /*works in popup only with this alert box.*/ /*else IE8 Hangs*/ winId.document.write('<script src="../js/tiny_mce/tiny_mce.js" type="text/javascript">Script_IE8</script>\n'); winId.document.write('<script type="text/javascript">\n'); winId.document.write('function inittextarea() {\n'); winId.document.write('tinyMCE.init({ \n'); winId.document.write('elements : "content",\n'); winId.document.write('theme : "advanced",\n'); winId.document.write('readonly : true,\n'); winId.document.write('mode : "exact",\n'); winId.document.write('theme : "advanced",\n'); winId.document.write('readonly : true,\n'); winId.document.write('setup : function(ed) {\n'); winId.document.write('ed.onInit.add(function() {\n'); winId.document.write('tinyMCE.activeEditor.execCommand("mceToggleVisualAid");\n'); winId.document.write('});\n'); winId.document.write('}\n'); winId.document.write('});}</script>\n'); winId.document.write('</head><body onload="inittextarea()">\n'); winId.document.write(' \n'); var hiddenFrameHTML = document.getElementById("HiddenFrame").innerHTML; hiddenFrameHTML = hiddenFrameHTML.replace(/&amp;/gi, "&"); hiddenFrameHTML = hiddenFrameHTML.replace(/&lt;/gi, "<"); hiddenFrameHTML = hiddenFrameHTML.replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML); winId.document.write('<textarea id="content" rows="10" style="width:100%">\n'); winId.document.write(document.getElementById(top.document.forms[0].id + ":supportStuff").innerHTML); winId.document.write('</textArea>\n'); var hiddenFrameHTML2 = document.getElementById("HiddenFrame2").innerHTML; hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&amp;/gi, "&"); hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&lt;/gi, "<"); hiddenFrameHTML2 = hiddenFrameHTML2.replace(/&gt;/gi, ">"); winId.document.write(hiddenFrameHTML2); winId.document.write('</body></html>\n'); winId.document.close(); } Please help me on this one. I could provide more information on this if needed. I have referred to these posts already: http://stackoverflow.com/questions/776639/problem-of-import-js-file-in-https-page-in-ie8 http://stackoverflow.com/questions/2597289/force-browser-modeie8-and-document-modeie8-standards Additional Information: Screen shot of the page Rendered HTML Original JSPF

    Read the article

  • Scope of This JavaScript Variable

    - by dkris
    I have a question and an issue wrt the code below: My question is what is the scope of the variable loaded here. The reason why i ask this is the onload="if(loaded==1)inittextarea() code is working fine on Firefox and not IE8. Why is this happening? Is there something specific i need to do here? Or is it not a valid practice? <html> <head> <title>Some Page</title> <link rel="stylesheet" href="../css/default.css" type="text/css"> <script type="text/javascript"> var loaded = 0; /*Point of interest*/ function jsLoaded() { loaded =1; } </script> <script type="text/javascript"> function inittextarea() { alert("test") tinyMCE.init({ elements : "content", theme : "advanced", readonly : true, mode : "exact", theme : "advanced", readonly : true, setup : function(ed) { ed.onInit.add(function() { tinyMCE.activeEditor.execCommand("mceToggleVisualAid"); }); } }); } </script> <script src="../js/tiny_mce/tiny_mce.js" onload="jsLoaded()" type="text/javascript"></script> </head> <body onload="if(loaded==1)inittextarea()"><!--Works on Firefox only--> *Usual stuff* </body></html> Any pointers please?

    Read the article

  • Formatting this JavaScript Line

    - by dkris
    Hi, I am trying to format this line of code in my popup window, but i am facing unterminated string literal error. Can somebody please tell me how best I could format this. window.setTimeout("winId.document.write('<script src="../js/tiny_mce/tiny_mce.js" type="text/javascript"></script>\n')", 10); Also point out if this particular line of code would work fine in the popup?

    Read the article

1