Forums / Templates, Stylesheets, Page Layout / Embed Javascript into ez page

Embed Javascript into ez page

Locked

Views: 4,155

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
15 Dec 2008, 1:07 AM
#1
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Embed Javascript into ez page

I'm trying to embed the code below into an ez page but just can't get it to work. I have all the files in my root directory and it works fine in an html page...

This is the code as it appears in the .html page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="expires" content="Sun, Dec 31 1970 12:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache">

<title>BananAlbum</title>

<script type="text/javascript" src="res/scripts.js"></script>
<script type="text/javascript" src="res/swfobject.js"></script>
<link rel="stylesheet" href="res/styles.css" type="text/css" charset="utf-8"></link>

</head>
<body bgcolor="#eeeeee">

<!-- Rudin Swagerman -->
<!-- thegreatesthits.net -->
<!-- 2007 -->

<!-- BananAlbum.net -->

	<div id="flashcontent">

	<noscript>
	<a href="http://www.bananalbum.com/go/enablejavascript/"><img src="res/PleaseEnableJavascript.gif"/></a>
	</noscript>

	<script type="text/javascript">
		document.write("<a href=\"http://www.bananalbum.com/go/getflash/\"><img src=\"res/PleaseUpdateFlashPlayer.gif\"/></a>");
	</script>
	</div>
	
	<script type="text/javascript">
		// <![CDATA[
		
	document.title = "Gallery";
	bgcolor = "#eeeeee";
	imgcolor = "#ffffff";
	linecolor = "#000000";
	txtcolor = "#000000";

		respath = "res/";
		var so = new SWFObject("res/BananAlbum.swf", "BananAlbum", "100%", "100%", "8", "#eeeeee");
		so.addVariable("jalbum", "true");
		so.addVariable("bgcolor", bgcolor.replace("#","0x"));
		so.addVariable("imgcolor", imgcolor.replace("#","0x"));
		so.addVariable("linecolor", linecolor.replace("#","0x"));
		so.addVariable("txtcolor", txtcolor.replace("#","0x"));
		so.addParam("allowFullScreen", "true");
		so.write("flashcontent");
		
		// ]]>
	</script>

</body>
</html>

Help will be appreciated!

15 Dec 2008, 5:20 AM
#2
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

Ok, after I've done some research I added the <script> between the <head> tahs inside the html_header file... and the rest in the ez page

Why does the <script> in the ez page collapse if I safe the the ez page. Just the <script> tags stay...

15 Dec 2008, 6:16 AM
#3
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Embed Javascript into ez page

Link to url where this is happening would help...

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

15 Dec 2008, 6:20 AM
#4
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

misty:

Link to url where this is happening would help...

Thanks, do you have the link? :blink::blush:

15 Dec 2008, 6:28 AM
#5
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Embed Javascript into ez page

rooisnor:

Thanks, do you have the link?
NO, you have link to your site where problem is happening..

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

15 Dec 2008, 6:31 AM
#6
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

misty:

NO, you have link to your site where problem is happening..

ok.. I see, but you won't see the problem on the site itself, it happens within the admin...

15 Dec 2008, 6:35 AM
#7
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

If I tries to embed the code below into the ez page

<body bgcolor="#eeeeee">

<!-- Rudin Swagerman -->
<!-- thegreatesthits.net -->
<!-- 2007 -->

<!-- BananAlbum.net -->

	<div id="flashcontent">

	<noscript>
	<a href="http://www.bananalbum.com/go/enablejavascript/"><img src="videos/res/PleaseEnableJavascript.gif"/></a>
	</noscript>

	<script type="text/javascript">
		document.write("<a href=\"http://www.bananalbum.com/go/getflash/\"><img src=\"videos/res/PleaseUpdateFlashPlayer.gif\"/></a>");
	</script>
	</div>
	
	<script type="text/javascript">
		// <![CDATA[
		
	document.title = "Gallery";
	bgcolor = "#eeeeee";
	imgcolor = "#ffffff";
	linecolor = "#000000";
	txtcolor = "#000000";

		respath = "video/res/";
		var so = new SWFObject("videos/res/BananAlbum.swf", "BananAlbum", "100%", "100%", "8", "#eeeeee");
		so.addVariable("jalbum", "true");
		so.addVariable("bgcolor", bgcolor.replace("#","0x"));
		so.addVariable("imgcolor", imgcolor.replace("#","0x"));
		so.addVariable("linecolor", linecolor.replace("#","0x"));
		so.addVariable("txtcolor", txtcolor.replace("#","0x"));
		so.addParam("allowFullScreen", "true");
		so.write("flashcontent");
		
		// ]]>
	</script>

...after I saved the page I get this...

<!-- Rudin Swagerman --><!-- thegreatesthits.net --><!-- 2007 --><!-- BananAlbum.net --><div id="flashcontent"><noscript /><script type="text/javascript"></script></div><script type="text/javascript"></script>

It seems like the entire script collapes... I tried everything... this happens inside the admin

15 Dec 2008, 6:57 AM
#8
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Embed Javascript into ez page

Try just posting

<div id="flashcontent">
 
    <noscript>
    <a href="http://www.bananalbum.com/go/enablejavascript/"><img src="videos/res/PleaseEnableJavascript.gif"/></a>
    </noscript>
 
    <script type="text/javascript">
        document.write("<a href=\"http://www.bananalbum.com/go/getflash/\"><img src=\"videos/res/PleaseUpdateFlashPlayer.gif\"/></a>");
    </script>
    </div>
 
    <script type="text/javascript">
        // <![CDATA[
 
    document.title = "Gallery";
    bgcolor = "#eeeeee";
    imgcolor = "#ffffff";
    linecolor = "#000000";
    txtcolor = "#000000";
 
        respath = "video/res/";
        var so = new SWFObject("videos/res/BananAlbum.swf", "BananAlbum", "100%", "100%", "8", "#eeeeee");
        so.addVariable("jalbum", "true");
        so.addVariable("bgcolor", bgcolor.replace("#","0x"));
        so.addVariable("imgcolor", imgcolor.replace("#","0x"));
        so.addVariable("linecolor", linecolor.replace("#","0x"));
        so.addVariable("txtcolor", txtcolor.replace("#","0x"));
        so.addParam("allowFullScreen", "true");
        so.write("flashcontent");
 
        // ]]>
    </script>

Make sure paths to needed files are correct..

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

15 Dec 2008, 7:04 AM
#9
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

misty:

Try just posting

<div id="flashcontent">
<noscript>
<a href="http://www.bananalbum.com/go/enablejavascript/"><img src="videos/res/PleaseEnableJavascript.gif"/></a>
</noscript>

<script type="text/javascript">
    document.write("<a href=\"http://www.bananalbum.com/go/getflash/\"><img src=\"videos/res/PleaseUpdateFlashPlayer.gif\"/></a>");
</script>
</div>

<script type="text/javascript">
    // <![CDATA[

document.title = "Gallery";
bgcolor = "#eeeeee";
imgcolor = "#ffffff";
linecolor = "#000000";
txtcolor = "#000000";

    respath = "video/res/";
    var so = new SWFObject("videos/res/BananAlbum.swf", "BananAlbum", "100%", "100%", "8", "#eeeeee");
    so.addVariable("jalbum", "true");
    so.addVariable("bgcolor", bgcolor.replace("#","0x"));
    so.addVariable("imgcolor", imgcolor.replace("#","0x"));
    so.addVariable("linecolor", linecolor.replace("#","0x"));
    so.addVariable("txtcolor", txtcolor.replace("#","0x"));
    so.addParam("allowFullScreen", "true");
    so.write("flashcontent");

    // ]]>
</script>
> Make sure paths to needed files are correct..

Yes,  I checked.. all files point  to /video/ folder...
15 Dec 2008, 7:06 AM
#10
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

Isn't this 'collapse' caused by the actual embedding of the script? I've tried various variations of embedding but it still appears to collapse!

15 Dec 2008, 7:19 PM
#11
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

I saved the next script in an ez page...

<script type="text/javascript">

		respath = "videos/res/";
		var so = new SWFObject("videos/res/BananAlbum.swf", "BananAlbum", "100%", "100%", "8", "#eeeeee");
		so.addVariable("jalbum", "true");
		so.addVariable("bgcolor", bgcolor.replace("#","0x"));
		so.addVariable("imgcolor", imgcolor.replace("#","0x"));
		so.addVariable("linecolor", linecolor.replace("#","0x"));
		so.addVariable("txtcolor", txtcolor.replace("#","0x"));
		so.addParam("allowFullScreen", "true");
		so.write("flashcontent");
		
	</script>

After I've saved the ez page, this is what is left of the script. The rest disappeared!

<script type="text/javascript"></script>
15 Dec 2008, 10:31 PM
#12
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Embed Javascript into ez page

without having actual script, difficult to test/advise....

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

15 Dec 2008, 10:50 PM
#13
rooisnor avatar

rooisnor

Zen Follower

Join Date:
Jul 2008
Posts:
192
Plugin Contributions:
0

Re: Embed Javascript into ez page

misty:

without having actual script, difficult to test/advise....

Hi misty... I send you a pm with directions:smile:

22 Dec 2008, 10:31 AM
#14
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Re: Embed Javascript into ez page

Any resolution to this yet? I'm having the same troubles.

22 Dec 2008, 10:55 AM
#15
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Embed Javascript into ez page

swamyg1:

Any resolution to this yet? I'm having the same troubles.
No...received files, unable to embed in zencart..

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others