i'm trying to embedd this into a page or block or anything for that matter on my drupal site and it does not seem to work.
i know this script works because when i paste it into a blank html document and upload it to my site manually (apart from the drupal cms) it works perfectly.

i added tags "<script>" into "input type" but that did not work. nothing showed up when published.
here is the code that does not work in any drupal nodes.

<script>
var tinychat = { room: 'roomname' };
</script>
<script src='http://tinychat.com/js/embed.js'></script>
<div id='client'></div>

what am i doing wrong?
can someone please help??

Comments

timmeh’s picture

i've tried every which way to make this work.
do i need some kind of module? like the embed field module or something?
i can't understand why embedding something so simple would not work.
it works in a regular html page. just not in drupal for some reason.

timmeh’s picture

ok i finally got it to work with this code but its lacks some of the features that it could have if it was just embeded.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="785" height="800" id="tinyembed" align="top">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="http://tinychat.com/tinyembed.swf" />

<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />

<param name="salign" value="t" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="roomVar=anyroomsname" />

<embed src="http://tinychat.com/tinyembed.swf" menu="false" quality="high" scale="noscale" salign="t" wmode="transparent" FlashVars="roomVar=anyroomsname" width="785" height="800" name="tinyembed" align="top" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

actually this code alone will work.

<embed src="http://tinychat.com/tinyembed.swf" menu="false" quality="high" scale="noscale" salign="t" wmode="transparent" FlashVars="roomVar=anyroomsname" width="785" height="800" name="tinyembed" align="top" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

can anyone tell me why this works and why the the script code in the first post does not work?

rasumo’s picture

I've successfully added all kind of JavaScript to my pages using blocks. The input format you should be using to achieve this is "Full HTML".

timmeh’s picture

i am using the full html format on this one. i've tried all the different formats, including adding my own custom formats with the 'script' '/script' with html brackets and that doesn't seem to work either.

is there a step i'm missing? it seems to be only when i try to embed with drupal. when i use a plain text editor to create a simple html page with only the embed code it works.

i found another site that had what i'm looking for.
its dofattv dot com
if you look at their html code it looks like this:

<div id="videoBox"><script type='text/javascript'>
var tinychat = { room: "examplechat", join: "auto", api: "list", oper: "none", owner: "none", colorbk: "0x878d8f", login: "twfb"};
</script>  <script src="http://tinychat.com/js/embed.js"></script>
<div id="client"><font size="1" color="#19191a">  often discussed:text here </font></div>
<div id="preloader"><center><img alt="" src="/public/images/loadingAnimation.gif" /><br />
Loading...</center></div>
<script>
function finishedLoading () {
$("#preloader").html ( "" );
}
</script></div>

and their code works! i think its something to do with the input type perhaps.
have any ideas??

timmeh’s picture

<div id="videoBox"><script type='text/javascript'>
var tinychat = { room: "examplechat", join: "auto", api: "list", oper: "none", owner: "none", colorbk: "0x878d8f", login: "twfb"};
</script>  <script src="http://tinychat.com/js/embed.js"></script>
<div id="client"><font size="1" color="#19191a">  often discussed:text here </font></div>
<div id="preloader"><center><img alt="" src="/public/images/loadingAnimation.gif" /><br />
Loading...</center></div>
<script>
function finishedLoading () {
$("#preloader").html ( "" );
}
</script></div>

i'm not having any luck. this looks like it should be easy to embed. but it's not. anyone???
btw you can acutally just embed this code, tinychat is "chat room on the fly". u can change "examplechat" to anything you want or just leave it as that.
anyone get this code to work???

_shane_’s picture

Which browser are you testing in? It seems that it will only work in quirks mode in Firefox.

_shane_’s picture

After further testing, it will work in FF by wrapping the div with id="client" with another div. Give the wrapper div a width and height.

reggie75’s picture

1. if its working with the "embed" tag why do you want to get it working specifically with the "Script" tag?
2. when you do a "view source" on the drupal page in which youve embedded it, can you see the code intact in the html, or is something getting stripped off?

guess youve already seen http://code.google.com/p/tinychat-embed-api/ for more help, if any

medden’s picture

To get this working I had to create a new page-node-50.tpl.php in my theme directory.

Then I took out the

<?php
// $Id: page.tpl.php,v 1.18.2.1 2009/04/30 00:13:31 goba Exp $
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

at the start.

Seems tinychat doesn't get on with strict/xhtml doctypes maybe.

Bit of a hacky way to get it working, but can't think of another way myself.

hope this info helps someone.