Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Javascript in DotNetNuke not working with external script.Javascript in DotNetNuke not working with external script.
Previous
 
Next
New Post
12/15/2011 4:33 AM
 
Hi,

I am trying to get a simple piece of code that includes javascript to run in a DNN Text/HTML module.

The code displays a text box and button. When the button is clicked, the testJoin() function is called which uses other functions in the external javascript http://assist.salt.na/webapi/api.js (referenced at beginning of code) to validate the input and return whatever is needed.

 
 

 The code below works 100% when running as a plain HTML file directly via browser. (HTML, HEADER and BODY tags have been removed as you do with DNN modules)

When I place the code in a text/HMTL module then it shows up correctly with the text box and "Connect" button that is used with the 'innerHTML' functions. (check picture)
But when the Connect button is clicked, it just reloads the whole page - it does not seem to call the testJoin() function or the function is not working correctly or whatever.

I have tried adding
<script type="text/javascript" src="http://assist.salt.na/webapi/api.js?libs=join&amp;webcallurl=http://assist.salt.na/__webcall__"></script>
to the header or footer of the module instead but it still does not work.

Can anyone tell me what I'm doing wroing?

Thanks!

 CODE:

<body>
	<script type="text/javascript" src="http://assist.salt.na/webapi/api.js?libs=join&amp;webcallurl=http://assist.salt.na/__webcall__"></script>

<table cellspacing="0" cellpadding="0" border="0">
<tr valign="bottom">
<td valign="bottom">
<img src="http://angelcy.biz/salt/form/images/remoteassisttop.jpg" alt="top" width="205" height="56" valign="bottom">
</td>
</tr>
<tr bgcolor="#e0e4ef" height="145px">
<td valign="top">
<div class="connect_form" >
<form id="connect_form" action="" onsubmit="testJoin();return false">
<div id="sessionformtext1" class="title">
</div>
<div id="sessionformbutton" class="code">
</div>

</form>
<noscript><div class="title">
Javascript disabled<br>or not supported<br>by your browser!<br><br>For remote support<br>go instead to: <br><a style="color: #607797" href="http://assist.salt.na">http://assist.salt.na</a>
</div>
</noscript>

<div id="feedbackJoin"></div>
</div>
</td>
</tr>
<tr>
<td>
<img src="http://angelcy.biz/salt/form/images/remoteassistbottom.jpg" alt="bottom" width="205" height="21">
</td>
</tr>
</table>
<script type="text/javascript">
<!--
document.getElementById('sessionformtext1').innerHTML = 'Enter session code:'
document.getElementById('sessionformbutton').innerHTML = '<input type="text" name="code" id="code"/><span class="submit"><input type="submit" value="connect" /></span>'
//-->
</script>



<script type="text/javascript">
<!--
function testJoin(){
var f=document.getElementById('connect_form');
ISLOnline.Join.getSessionInfoByCode(
f.code.value,
function(info){
var e=document.getElementById('feedbackJoin');
e.className='start';
e.style.color="#333";
e.style.fontSize="13px";
e.style.textAlign="center";
e.style.marginLeft="-18px";

e.innerHTML='Click Start button:';

var b=document.createElement('input');
e.className='start';
b.type='button';
b.name='join';
b.value='Start';
b.onclick=function(){info.join()};
e.appendChild(b);
},
function(error){
var e=document.getElementById('feedbackJoin');
e.className='error';
e.style.textAlign="center";
e.innerHTML='Invalid session code!';
/* comment the line above and uncomment the line below if you wish to
display the error that is sent by the server */
//e.innerHTML=error.getDescription();
}
)
}
//-->
</script>
</body>
</html>
Detect language » English

Detect language » English

Detect language » English

Detect language » English

Detect language » English

Detect language » English

Detect language » English

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Javascript in DotNetNuke not working with external script.Javascript in DotNetNuke not working with external script.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out