Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Javascript into Editable HTML Region View modes: 
User avatar
Member
Member
asovrano-opera21 - 9/18/2013 8:08:57 AM
   
Javascript into Editable HTML Region
I've got a Editable text webpart configured as Html Editor. There's no container or envelop. The page template is common to other different pages, has nothing specific for the current functionality and there's no JS webpart anywhere. The problem is:
in the source code of the page I can see the following code
	<div class="pagebody_container">
<script type='text/javascript'>
<!--
function Appari(){
for (i=0; i<9; i++) { alert(i)
document.getElementById('id'+i).style.display='none';
}

document.getElementById(document.getElementById('regioni')[document.getElementById('regioni').selectedIndex].value).style.display='block';
}
-->
</script>

<h2>Contatti THUN</h2>

whereas the source code into the editable region starts with:
<h2>Contatti THUN</h2>

I really cannot understand where the javascript function is !!!
Is there anyone who can help me with this topic ? Where can I find the function Appari(), I need to modify it.
Thank you very very much in advance for your help, Kind Regards
Andrea

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/19/2013 11:56:40 AM
   
RE:Javascript into Editable HTML Region
Its been a while since I've worked with v5 but in v7 there is a javascript webpart, you would place that on your page and enter your script. The other method would be to create a .js file and store it in the file system and add it in your editable text webpart as you would normally. Something like this
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fjquery%2fjquery-core.js" type="text/javascript"></script>

User avatar
Member
Member
asovrano-opera21 - 9/20/2013 2:00:08 AM
   
RE:Javascript into Editable HTML Region
Thank you FroggEye. The problem is: I have to modify an existing page but I really cannot find this javascript function anywhere ! the function is immediatly before the editable content but no js webpart is on the page and no script tag is in the editable region. It's a mistery for me ! Andrea

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/20/2013 7:16:54 AM
   
RE:Javascript into Editable HTML Region
Check out the properties of the webpart then and look at the content before property. Sounds like it is in there. Depending on your page template setup it could also be in the webpart zone or the layout as well.