adding java script in publisher 2007

P

pabrex

I'm trying to add java script to my publisher website. I'm using the Edit
HTML Code Fragment but all that happens is the script ends up on the page.
What do I need to do to make this work?
Thanks
 
D

DavidF

After you type or paste a code snippet into a HTML code fragment box and
*insert* it into the page, the box will be visible on the publication page
until you do a web page preview or publish the page. Is the code fragment
box visible after doing a web page preview? If so then go back and study the
instructions for using the code. If that doesn't work, then post a link to
the page where you found the javascript code snippet and we will take a
look, and describe in detail how you are trying to insert it into your web
page.

DavidF
 
A

Anne Gardner

I've been having the same problem... Do you think you would mind
taking a look at my code and letting me know if you see something?
This is the best photo gallery I've found for what I'm doing and it
looks like it's ready to go, I just need to get it into Publisher.
Thing is, I've been doing so many revisions on this to figure it out
what's wrong, I've already spent three days working on it, so now I'm
determined to do whatever is necessary. I wanted this site completed
by tomorrow! Any help would be COMPLETELY APPRECIATED!

Anne

<xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>BlackCrossroad.com Presents... the Black Angels - powered by
the AirtightInteractive Tiltviewer Picasa template from www.paulvanroekel.nl</title>
<style type="text/css">
/* hide from ie on mac \*/
html {
height: 100%;
overflow: hidden;
}

#flashcontent {
height: 100%;
}
/* end hide */

body {
height: 100%;
margin: 0;
padding: 0;
background-color: #000000;
color:#ffffff;
font-family:sans-serif;
font-size:40;
}

a {
color:#cccccc;
}
</style>
<script type="text/javascript" src="http://www.blackcrossroad.com/
index_files/Angels/theBlackAngels/swfobject.js">
var fo = new SWFObject("http://www.blackcrossroad.com/index_files/
Angels/theBlackAngels/TiltViewer.swf", "viewer", "100%", "100%",
"9.0.28", "#000000");

// TILTVIEWER CONFIGURATION OPTIONS
// To use an option, uncomment it by removing the "//" at the start
of the line
// For a description of config options, go to:
// http://www.airtightinteractive.com/projects/tiltviewer/config_options.html

//FLICKR GALLERY OPTIONS
// To use images from Flickr, uncomment this block
//fo.addVariable("useFlickr", "true");
//fo.addVariable("user_id", "48508968@N00");
//fo.addVariable("tags", "jump,smile");
//fo.addVariable("tag_mode", "all");
//fo.addVariable("showTakenByText", "true");

// XML GALLERY OPTIONS
// To use local images defined in an XML document, use this block
fo.addVariable("useFlickr", "false");
fo.addVariable("xmlURL", "http://www.blackcrossroad.com/index_files/
Angels/theBlackAngels/gallery.xml");
fo.addVariable("maxJPGSize","900");

//GENERAL OPTIONS
fo.addVariable("useReloadButton", "false");
fo.addVariable("columns", "5");
fo.addVariable("rows", "5");
//fo.addVariable("showFlipButton", "true");
fo.addVariable("showLinkButton", "false");
//fo.addVariable("linkLabel", "View image info");
fo.addVariable("frameColor", "0xFFFFFF");
fo.addVariable("backColor", "0x999999");
fo.addVariable("bkgndInnerColor", "0x666666");
fo.addVariable("bkgndOuterColor", "0x000000");
//fo.addVariable("langGoFull", "Go Fullscreen");
//fo.addVariable("langExitFull", "Exit Fullscreen");
//fo.addVariable("langAbout", "About");

// END TILTVIEWER CONFIGURATION OPTIONS

fo.addParam("allowFullScreen","true");
fo.write("flashcontent");
</script>
 
D

DavidF

Anne,

You haven't provided enough information for me to figure out exactly what
you did wrong. When I went to
http://www.simpleviewer.net/tiltviewer/index.html and then to the
instructions page: http://www.simpleviewer.net/tiltviewer/docs.html it
appeared that you had 4 or 5 different optional approaches including access
your pictures from a Flickr Gallery or Picasa. This means I can't tell you
what is wrong, and you just need to study the instructions for the method
you chose...or try a different method if you can't get one to work.

One observation I did make is that it appears that all your links within the
code are pointing toward the 'index_files" folder on your site which is
where you would be the supporting Publisher folder containing all the extra
pages of your site and all the supporting graphics and images. I have found
that anytime I have used a javascript slide show or some such, I find it
easier if I segregate the files from the Publisher web files. Don't forget
that each time you update you main Publisher web, you will create a new
'index_files' folder which will overwrite the old folder, which would mean
that if you have any extra files for the album/slide show in there, you
would have to upload them again. Instead I create a subfolder on my host at
the same directory level as the 'index.htm' file and the 'index_files"
folder, and perhaps call it 'album'. The I put the required JS in that
folder along with any images that I must store on my host for the
album/slide show to work. Then I also always write a full path, or an
absolute link to that folder and the files within. Relative links tend to
confuse me and I make mistakes that I can't trouble shoot. Here is a
possible example:

You posted the following code snippet:

</style>
<script type="text/javascript" src="http://www.blackcrossroad.com/
index_files/Angels/theBlackAngels/swfobject.js">
var fo = new SWFObject("http://www.blackcrossroad.com/index_files/
Angels/theBlackAngels/TiltViewer.swf", "viewer", "100%", "100%",
"9.0.28", "#000000");

Notice you are saying the javascript is located in the "index_files' folder:
src="http://www.blackcrossroad.com/index_files/Angels/theBlackAngels/swfobject.js">
If you created the subfolder 'album' at the same directory level, then the
link would be written:
src="http://www.blackcrossroad.com/album/Angels/theBlackAngels/swfobject.js">
and the flash file would also be located there, and you would make the same
change. Instead of:
http://www.blackcrossroad.com/index_files/Angels/theBlackAngels/TiltViewer.swf
you would write:
http://www.blackcrossroad.com/album/Angels/theBlackAngels/TiltViewer.swf

Try creating the subfolder to contain all the javascript and images for your
album/slide show and rewriting your links and see if that doesn't help you
sort through this. Hope this helps...

And if it doesn't then I have also used JAlbum but have found Porta:
http://stegmann.dk/mikkel/porta/ to be the easiest photo album tool to use.

DavidF


I've been having the same problem... Do you think you would mind
taking a look at my code and letting me know if you see something?
This is the best photo gallery I've found for what I'm doing and it
looks like it's ready to go, I just need to get it into Publisher.
Thing is, I've been doing so many revisions on this to figure it out
what's wrong, I've already spent three days working on it, so now I'm
determined to do whatever is necessary. I wanted this site completed
by tomorrow! Any help would be COMPLETELY APPRECIATED!

Anne

<xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>BlackCrossroad.com Presents... the Black Angels - powered by
the AirtightInteractive Tiltviewer Picasa template from
www.paulvanroekel.nl</title>
<style type="text/css">
/* hide from ie on mac \*/
html {
height: 100%;
overflow: hidden;
}

#flashcontent {
height: 100%;
}
/* end hide */

body {
height: 100%;
margin: 0;
padding: 0;
background-color: #000000;
color:#ffffff;
font-family:sans-serif;
font-size:40;
}

a {
color:#cccccc;
}
</style>
<script type="text/javascript" src="http://www.blackcrossroad.com/
index_files/Angels/theBlackAngels/swfobject.js">
var fo = new SWFObject("http://www.blackcrossroad.com/index_files/
Angels/theBlackAngels/TiltViewer.swf", "viewer", "100%", "100%",
"9.0.28", "#000000");

// TILTVIEWER CONFIGURATION OPTIONS
// To use an option, uncomment it by removing the "//" at the start
of the line
// For a description of config options, go to:
//
http://www.airtightinteractive.com/projects/tiltviewer/config_options.html

//FLICKR GALLERY OPTIONS
// To use images from Flickr, uncomment this block
//fo.addVariable("useFlickr", "true");
//fo.addVariable("user_id", "48508968@N00");
//fo.addVariable("tags", "jump,smile");
//fo.addVariable("tag_mode", "all");
//fo.addVariable("showTakenByText", "true");

// XML GALLERY OPTIONS
// To use local images defined in an XML document, use this block
fo.addVariable("useFlickr", "false");
fo.addVariable("xmlURL", "http://www.blackcrossroad.com/index_files/
Angels/theBlackAngels/gallery.xml");
fo.addVariable("maxJPGSize","900");

//GENERAL OPTIONS
fo.addVariable("useReloadButton", "false");
fo.addVariable("columns", "5");
fo.addVariable("rows", "5");
//fo.addVariable("showFlipButton", "true");
fo.addVariable("showLinkButton", "false");
//fo.addVariable("linkLabel", "View image info");
fo.addVariable("frameColor", "0xFFFFFF");
fo.addVariable("backColor", "0x999999");
fo.addVariable("bkgndInnerColor", "0x666666");
fo.addVariable("bkgndOuterColor", "0x000000");
//fo.addVariable("langGoFull", "Go Fullscreen");
//fo.addVariable("langExitFull", "Exit Fullscreen");
//fo.addVariable("langAbout", "About");

// END TILTVIEWER CONFIGURATION OPTIONS

fo.addParam("allowFullScreen","true");
fo.write("flashcontent");
</script>
 
A

Anne Gardner

A

Anne Gardner

Wow! Thank you for the quick reply, David! Ok... so I gave up on the
tiltviewer because the Porta looks great. But... Porta doesn't seem to
offer the code to use to load it onto my Publisher file. What codes do you
use?
 
A

Anne Gardner

It worked! I used the text from the index file and removed the head/body
tags... THANK YOU!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top