vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v3.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2007, 04:19 PM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Javascript in page

Hi all,

Im adding a page to vbadvanced CMPS which contains an applet to enter IRC (chat). It has a form, and a <script LANGUAGE="Javascript"> code.

When i load the page, it doesnt show anything, only the header an left column... when it starts loading the custom content of the page... it dont load anything more...

Is there any thing to do for loading <script LANGUAGE="Javascript"> in cmps pages???
Reply With Quote
  #2  
Old 12-18-2007, 06:00 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Javascript in page

Do you have this working outside of the CMPS? If so, can you post the code from the working version?
Reply With Quote
  #3  
Old 12-18-2007, 06:20 PM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Re: Javascript in page

The cmps page points to a html file. If i load this htmls file directly, it runs perfect. But when load it as cmps?id=page no :S

The code is:

Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chat - domain .com</title>
</head>

<body>
<script LANGUAGE="Javascript">

function chat() {

bocazas= window.open('', 'Bocazas','status=1,width=640,height=500');
bocazas.document.open();
bocazas.document.write('<html><head><title>Chat domain .com</title></head>');
bocazas.document.write('<body bgcolor=\"#000000\" text=\"#0000ff\"><center>Espere mientras se carga el applet</center><center>\n');
bocazas.document.write('<applet archive=\"http://www.domain.com/chat/bocazas.jar\" code=bocazas.class width=620 height=450>\n');
bocazas.document.write('<param name=\"CABBASE\" value=\"http://www.domain.com/chat/bocazas.cab\">\n');
bocazas.document.write('<param name=\"nickname\" value=\"'+document.form.nick.value+'\">\n');
bocazas.document.write('<param name=\"Channel1\" value=\"'+document.form.canal.options[document.form.canal.selectedIndex].value+'\">\n');
bocazas.document.write('<param name=\"Server1\" value=\"'+document.form.servidor.options[document.form.servidor.selectedIndex].value+'\">\n');
bocazas.document.write('<param name=\"Language1\" value=\"'+document.form.language.options[document.form.language.selectedIndex].value+'\">\n');
bocazas.document.write('<param name=\"List\" value=\"'+document.form.list.checked+'\">\n');
bocazas.document.write('<param name=\"Popup\" value=\"false\">\n');
bocazas.document.write('</applet></center></body></html>');
bocazas.document.close();
}

</script>


<form name="form" method='get'>
<p align="center">
<b><font face="Verdana" size="5" color="#AFADAE"><br>
CANAL #<font color="#6384b0">domain</font> EN DALnet</font></b><br>
</p>
<div align="center">
<table border=0 cellpadding=4 bgcolor="#ffffff" width="70%">
<tr>
<td bgcolor="#C0C0C0" align="right">
<font face="verdana, arial, helvetica" size=2 color="#FFFFFF"><b>Nick</b></font></td>
<td bgcolor="#C0C0C0" align="left">
<tt><font face='Courier' color="#808080" size='3'><input name='nick' size=9 maxlength='9' style="FONT-FAMILY: Courier"></font></tt><font color="#808080">
</font> </td>
</tr>
<tr>
<td bgcolor="#E5E5E5" align="right">
<font face="verdana,arial,helvetica" size=2 color="#808080"><b>Canal:</b></font><font color="#808080">
</font> </td>
<td bgcolor="#E5E5E5" align="left">
<tt><font face="Courier" color="#808080" size=3>
<SELECT name="canal" style="FONT-FAMILY: Courier">
<option value="#domain"
selected>#domain</option>
</SELECT>
</font></tt> </td>
</tr></TR>
<tr>
<td bgcolor="#C0C0C0" align="right">
<font face="verdana,arial,helvetica" size=2 color="#808080"><b><font color="#FFFFFF">Idioma:</font></b></font></td>
<td bgcolor="#C0C0C0" align="left">
<tt><font face="Courier" color="#808080" size=3>
<SELECT name="language" style="FONT-FAMILY: Courier">
<option value="Español" selected>Español</option>
<option value="English">English</option>
<option value="Aleman">Aleman</option>
<option value="Català">Català</option>
</SELECT>
</font></tt> </td>
</tr>
<tr>
<td bgcolor="#E5E5E5" align="right">
<font face="verdana,arial,helvetica" size=2 color="#808080"><b>Servidor:</b></font><font color="#808080">
</font> </td>
<td bgcolor="#E5E5E5" align="left">
<font face="Courier" size=2 color="#808080">
<SELECT name="servidor" style="FONT-FAMILY: Courier">
<option value="irc.dal.net" selected>irc.dal.net</option>
</SELECT>
</font> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#C0C0C0" align="center">
<font face="verdana,arial,helvetica" size=2 color="#808080">
<INPUT type="checkbox" name="list" value="ON">
<font color="#FFFFFF"><b>Listar canales al entrar</b></font></font></tr>
<tr>
<td colspan="2" bgcolor="#E5E5E5" align="middle" heigt="50">
<input type="button" value="Conectar" onClick="chat();" id=button1 name=button1>
<br> </td>
</tr>
</table>
</div>
</form>
<p align="center">Para entrar con tu cliente de IRC habitual:<br />
<strong>Servidor</strong>: irc.dal.net&nbsp;&nbsp;&nbsp; <strong>Canal</strong>: #domain</p>
<p>&nbsp;</p>
</body>
</html>
Reply With Quote
  #4  
Old 12-22-2007, 03:49 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Javascript in page

Hrmm... Not seeing anything obvious there. Can you link me to the CMPS page you've created for your chat page?
Reply With Quote
  #5  
Old 12-22-2007, 04:22 PM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Re: Javascript in page

Yep, the site is not running yet, cause i havent finished all the sections, but chat is here:
http://www.madridnoche.com/cmps_index.php?pagina=chat

An direct html is at: http://www.madridnoche.com/foros/paginas/chat/chat.html

Last edited by Josechu; 12-22-2007 at 04:28 PM.
Reply With Quote
  #6  
Old 12-23-2007, 02:43 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Javascript in page

Try looking in your chat/chat.html file for this line:
Code:
</body></html>
And replace with this:
Code:
</ body></ html>
(just adding a space between the < and the /)

The CMPS looks for tags like </body> and </html> when including pages like that in order to cut them off in the proper place and avoid any problems with XHTML validation. If you add the spaces like that though, it should prevent the CMPS from cutting the code off at that point and allow the rest of the code to be printed properly.
Reply With Quote
  #7  
Old 12-23-2007, 06:15 PM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Re: Javascript in page

Same result ... it doesnt load de content frame.
Reply With Quote
  #8  
Old 12-26-2007, 04:53 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Javascript in page

Did you perhaps forget to upload the chat/chat.html file after making that change? It still seems to be cutting off in the same place, which shouldn't happen if it can't find those exact tags (</body> </html).
Reply With Quote
  #9  
Old 12-31-2007, 08:26 AM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Re: Javascript in page

No, the file is uploaded in right place.

I f in edit the chat.html page, and delete the "<script LANGUAGE="Javascript">.................</script>" part, then the page loadscorrectly, so the error is in javascript code... but i dont know where :S
Reply With Quote
  #10  
Old 12-31-2007, 10:44 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Javascript in page

Sorry if I wasn't specific enough the first time. This is the line that you need to be modifying though:

PHP Code:
bocazas.document.write('</applet></center></body></html>'); 
Change that line to this and it *should* allow the applet to work.
PHP Code:
bocazas.document.write('</applet></center></ body></ html>'); 
Reply With Quote
  #11  
Old 01-02-2008, 11:20 AM
Josechu Josechu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 21
Default Re: Javascript in page

Wow, now it works perfect. Many thanks Brian
Reply With Quote
  #12  
Old 01-20-2008, 08:18 PM
fn9mm fn9mm is offline
Junior Member
 
Join Date: Sep 2005
Posts: 4
Default Re: Javascript in page

damn, I'm having the same problem with a vbjirc chat script
the direct URL to the html file works perfectly, but when I embed it in a CMPS page, It starts loading, then shows a red cross, ....
Any help much appreciated !!
I tried the tps mentioned above, but they don't help

here's the url to the page with cmps
http://www.abforum.be/index.php?page=chat

here's the direct html dir
http://www.abforum.be/vbjirc/HeavylApplet.html

and the code
Code:
<html>
<head>
<title>ABForum IRC chat</title>
</head>
<body>
<h1>Test page for IRCApplet Class</h1><hr>
<applet code=IRCApplet.class archive="irc.jar,pixx.jar" width=640 height=400>
<param name="CABINETS" value="irc.cab,securedirc.cab,pixx.cab">

<param name="nick" value="Fn9mm">
<param name="alternatenick" value="ABF Gast??">
<param name="fullname" value="Fn9mm - ABF Admin">
<param name="host" value="irc.rizon.net">
<param name="port" value="6667">
<param name="command1" value="/join #"abf>
<param name="gui" value="pixx">

<param name="quitmessage" value="has left us">
<param name="asl" value="true">
<param name="useinfo" value="true">

<param name="style:bitmapsmileys" value="true">
<param name="style:smiley1" value=":) img/sourire.gif">
<param name="style:smiley2" value=":-) img/sourire.gif">
<param name="style:smiley3" value=":-D img/content.gif">
<param name="style:smiley4" value=":d img/content.gif">
<param name="style:smiley5" value=":-O img/OH-2.gif">
<param name="style:smiley6" value=":o img/OH-1.gif">
<param name="style:smiley7" value=":-P img/langue.gif">
<param name="style:smiley8" value=":p img/langue.gif">
<param name="style:smiley9" value=";-) img/clin-oeuil.gif">
<param name="style:smiley10" value=";) img/clin-oeuil.gif">
<param name="style:smiley11" value=":-( img/triste.gif">
<param name="style:smiley12" value=":( img/triste.gif">
<param name="style:smiley13" value=":-| img/OH-3.gif">
<param name="style:smiley14" value=":| img/OH-3.gif">
<param name="style:smiley15" value=":'( img/pleure.gif">
<param name="style:smiley16" value=":$ img/rouge.gif">
<param name="style:smiley17" value=":-$ img/rouge.gif">
<param name="style:smiley18" value="(H) img/cool.gif">
<param name="style:smiley19" value="(h) img/cool.gif">
<param name="style:smiley20" value=":-@ img/enerve1.gif">
<param name="style:smiley21" value=":@ img/enerve2.gif">
<param name="style:smiley22" value=":-S img/roll-eyes.gif">
<param name="style:smiley23" value=":s img/roll-eyes.gif">
<param name="style:backgroundimage" value="true">
<param name="style:backgroundimage1" value="all all 0 background.gif">
<param name="style:sourcefontrule1" value="all all Serif 12">
<param name="style:floatingasl" value="true">

<param name="pixx:timestamp" value="true">
<param name="pixx:highlight" value="true">
<param name="pixx:highlightnick" value="true">
<param name="pixx:nickfield" value="true">
<param name="pixx:styleselector" value="true">
<param name="pixx:setfontonstyle" value="true">

</ applet>

<hr></ body>
</ html>
Reply With Quote
  #13  
Old 01-20-2008, 08:38 PM
fn9mm fn9mm is offline
Junior Member
 
Join Date: Sep 2005
Posts: 4
Default Re: Javascript in page

OK, I solved it by putting these files (IRCApplet.class, irc.jar,pixx.jar, irc.cab, securedirc.cab, pixx.cab) mentioned in the code in my root directory. (edit : works only in IE, not in FF)
Could there be anyway to point to the files in this code in their original dirs ?
being ./vbjirc/ ???

Last edited by fn9mm; 01-20-2008 at 08:48 PM.
Reply With Quote
  #14  
Old 01-20-2008, 09:29 PM
fn9mm fn9mm is offline
Junior Member
 
Join Date: Sep 2005
Posts: 4
Default Solved

FYI and others who could use it
changed this line
Code:
<applet code=IRCApplet.class archive="irc.jar,pixx.jar" width=640 height=400>
to
Code:
<applet CODEBASE="http://www.abforum.be/vbjirc/" code=IRCApplet.class archive="irc.jar,pixx.jar" width=640 height=400>
thus indicating the base dir for the applet and so ...

Hope this helps anyone ..
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript on vb page breaks Renada Troubleshooting & Problems 10 08-22-2007 06:31 AM
Javascript Installation Nuguru "How Do I..." Questions 1 08-10-2006 09:13 AM
JavaScript Help!!! azntfl Troubleshooting & Problems 5 06-16-2006 09:12 AM
javascript not working on front page for vba apokalupsis "How Do I..." Questions 5 11-17-2005 10:31 PM
adding javascript lykenu Troubleshooting / "How do I..." Questions 3 04-14-2005 04:04 PM


All times are GMT -4. The time now is 08:32 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.