Embedded html not displaying javascript

Asked by Brian Mathis

Hello -

I setup a region to use the embedded html option so I can have a transparent background instead of having a solid color. The code uses PHP and Javascript to show the current date and time and has been tested on its own before inserting it into the region, but upon saving and testing on a display, the code after the java script tag is shown instead of the desired output. Are there any escapes that I need to insert into the code to make it work? or is it just not possible to embed javascript?

Thanks,

B

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

Hi,
I must confess to not having tried any JavaScript with the embed option,
however I can tell you that PHP will definitely not work. The Xibo client
does not have a web server and nothing to execute the PHP.

Would it be possible to send your HTML (as it is) to <email address hidden> so I
could see exactly what you are trying to do?

Cheers,
Dan

2009/7/2 bmathis <email address hidden>

> New question #75866 on Xibo:
> https://answers.launchpad.net/xibo/+question/75866
>
> Hello -
>
> I setup a region to use the embedded html option so I can have a
> transparent background instead of having a solid color. The code uses PHP
> and Javascript to show the current date and time and has been tested on its
> own before inserting it into the region, but upon saving and testing on a
> display, the code after the java script tag is shown instead of the desired
> output. Are there any escapes that I need to insert into the code to make it
> work? or is it just not possible to embed javascript?
>
> Thanks,
>
> B
>
> --
> You received this question notification because you are a member of Xibo
> Developers, which is an answer contact for Xibo.
>

Revision history for this message
Brian Mathis (bcmathis) said :
#2

the file was sent.

Revision history for this message
Alex Harrington (alexharrington) said :
#3

Hi Brian

The section where it says "Uncomment for PHP webserver" is the problem. The client won't be able to run that line since you're asking for an instance of PHP to return the current time.

You could upload this file on to the webserver where you're running Xibo and then embed it as a webpage - which should then work.

Cheers

Alex

Revision history for this message
snowman386 (bensnowden) said :
#4

the embedded html was not working as i expected either. here are the two widget i had placed on our webserver before and was hoping they would work in the embedded html object.

Clock:
<script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj=new Object;obj.clockfile="5001-gray.swf";obj.TimeZone="EST";obj.width=240;obj.height=20;obj.Place="";obj.DateFormat="mm-DD-YYYY";obj.wmode="transparent";showClock(obj);</script>

and weather:
<embed pluginspage="http://www.adobe.com/go/getflashplayer" src="http://www.yourminis.com/Dir/GetContainer.api?uri=yourminis/yourminis/mini:weather" wmode="transparent" width="250" height="80" FlashVars="loc=Loveland%2C%20OH%20%2845140%29&unit=s&zipcode=45140&dayview=5day&title=Weather%20%2845140%29&mininame=weather&height=70&width=240&xheight=80&xwidth=250&uri=yourminis%2Fyourminis%2Fmini%3Aweather&swfurl=%2Fwidget%5Fweatherchannel%2Eswf&" type="application/x-shockwave-flash" allowScriptAccess="always"></embed>

its no problem for me to switch back to the webpage but was hoping the embedded html would work for our content designers since they are not keen on html and webservers.

Revision history for this message
Dan Garner (dangarner) said :
#5

Hi there...

What specifically doesn't work?

I can see that the clock JavaScript might not work as it referenced "5001-gray.swf" and the client will not have access to that... the embed of flash seems feasible though...

Revision history for this message
snowman386 (bensnowden) said :
#6

well i have 2 different regions with this html embedded. nothing shows up in either region. i can open the html file on my desktop and it works fine. I have never downloaded any shockwave file.

Revision history for this message
Dan Garner (dangarner) said :
#7

Hi,

Can you create a file on your client pc called test.html and paste
your embed code into it?

Can you then right click and open with IE...

If the flash displays through this test html file then it should
display in Xibo.

I will try to test this tomorrow...

Cheers,
Dan

Revision history for this message
snowman386 (bensnowden) said :
#8

everything loads fine in IE when i open the file locally.

Revision history for this message
Dan Garner (dangarner) said :
#9

Did you have to "Allow ActiveX control" before it worked?

Xibo will open and embedded code using the "My Computer" zone in internet explorer - this is because it stores everything locally on the PC. I found that when I copied both the Flash and the JS into a local HTML file and then opened with IE (simulating what Xibo does) I got an "allow blocked content" message bar at the top of the screen.... after allowing the blocked content it worked no problems.

I think to get Xibo to show these embedded snippets of HTML you would need to adjust the security settings of IE so that local files were allowed to run active content by default. This can be done in Tools -> Internet Options -> Advanced -> Security -> "Allow Active content to run in files on My Computer"

This may have an impact on security - I am not sure...

Cheers,
Dan

Revision history for this message
snowman386 (bensnowden) said :
#10

ok. i did not receive anything in the information bar when i opened the file on the display but i will try changing the security setting and see if th changes anything. will let you know the result.

Revision history for this message
snowman386 (bensnowden) said :
#11

ok. i checked that security setting and still no joy. I even uninstalled the client and reinstalled it. The client is on xp pro with ie7. I reset all the security settings back to default and i did get that information bar warning you spoke of. I reenabled the allow active content setting to remove the info bar warning but it still does not display. Any logs i can send?

Revision history for this message
Dan Garner (dangarner) said :
#12

I have XP Pro and IE7 and after changing the setting for active content I did get the Weather widget... I did not get the clock widget however.

I am a little surprised that changing the settings on your IE did not get the weather widget working - what is your exact IE version? Could someone else run a test on this (Alex ;-) I have it working on two machines...

I don't think the clock widget will work without some changes to the client... currently it will not evaluate any of the JavaScript contained in the embedded html... If you could find a flash clock I'm sure that would work..

Cheers,
Dan

Revision history for this message
snowman386 (bensnowden) said :
#13

youre right. i tried it again today with just the weather widget and it worked. before i had the two widgets in two separate regions. maybe that was the problem.

Revision history for this message
snowman386 (bensnowden) said :
#14

my luck continues. i went back to the website where i found the clock widget and they have alternate code for the clock that just includes the flash code. I put it in a new region and it works like a charm. Now I got the weather and clock both embedded. Keep up the good work on Xibo!

Revision history for this message
Dan Garner (dangarner) said :
#15

Glad you have both things working!! I have opened a bug (linked) for the JavaScript not being called on page load and will try and implement some way around this for 1.0.3

In the mean time - enjoy your flash clock!!

Cheers,
Dan

Revision history for this message
Tommie (xpressiontommie) said :
#16

Hi Dan, Alex, and SnowMan386,
I am also having some few issues with the rss update and my flash file. I currently have a flash file that does import rss feed using php to import the feeds into the flash file on the link: http://www.mindworxinc.com/newsignage/newnew.swf
I however tried to import the flash file into xibo and it did work but the the problem I am having now is that my rss feeds would not load. It returns an error saying the feed is undefined but it still works perfectly in a typical browser but it is not working in the client.
Do you know what could be wrong?
Thanks.
Tommie O.

Revision history for this message
Alex Harrington (alexharrington) said :
#17

Hi Tommie

I really don't understand.

Are you saying that when you embed your flash file in Xibo, the flash file stops working? Or are we talking about you adding a separate Xibo RSS media type to a region on the same layout?

If so, does the RSS work on its own on the layout? If not, what's the RSS feed URL?

Also this is a different subject than the original thread. It's great to look back through old answers to see if there's something that can help you but if the answer is solved and about something different (in this case executing Javascript) then it's usually better to start a new thread.

Alex