/    Sign up×
Community /Pin to ProfileBookmark

old fart needs help

I’m a newbie trying to get javascripts to work.

I have no idea what I’m missing.

Perhaps some kind sole would look at it and tell me whats wrong or copy and paste something here or I can attach the file.

My site is:
[url]http://webpages.charter.net/robme/jas/jas.htm[/url]

It came from here:
[url]http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=11372[/url]

Thank you
boB

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@NedalsApr 16.2007 — Not sure what this does but...

You are calling the javascript from within your style sheet. You also need to remove the </script> near the end of your style sheet.

Change to:

<style type="text/css">

...

</style>

<script type="javascript/text" src="jas.js"></script>

You may need to change the "jas.js" unless you put 'jas.js' in the 'jas' directory'.
Copy linkTweet thisAlerts:
@suntinApr 16.2007 — ^I suspect the above post is correct, wouldn't imaging linking to a javascript file inside a css tag will work, but it may be exploiting a bug.

The MAIN problem though is the way you are linking to the file:

<script type="[B]h:/slide show/jas/javascript[/B]" src="jas.js">

The type is usually optional so I'd leave it out.

But if you want it then it's probably "text/javascript" rather than a link to a file on your HDD.

<script type="text/javascript" src="jas.js">

and that assumes jas.js is in the same directory as the page doing the calling.
Copy linkTweet thisAlerts:
@bob8611authorApr 16.2007 — thanks guys

I changed the script call and moved it above <style type="text/css">

Should the slash be there showing the js file in a sub-directory?? <script type="javascript/text" src="[B]/[/B]jas/jas.js">

It still won't work, with or with out the slash!!!?
Copy linkTweet thisAlerts:
@NedalsApr 16.2007 — Should be as suntin showed. My typo ?

<script type="text/javascript" src=".....>

You put the jas.js file in some directory. You must include the path and filename in "src=path-to-file/jas.js". If it in the same directory that contains the HTML page, there will be no path.

[i]Should slash be there showing the js file in a sub-directory[/i]

On a UNIX/Linux server the slash is used to always start the path at the webroot. (I not sure if this works on a $MS server).
Copy linkTweet thisAlerts:
@bob8611authorApr 16.2007 — Thanks 4 responding.?

I put all files in the same sub-dir for sake of troubleshooting.

The program now indicates the htm file is reading the js file.

Picture captions change when I start the slide show. However the pics are missing.

I examined both files checking for a path problem and see nothing wrong.?

Thanks boB
Copy linkTweet thisAlerts:
@NedalsApr 16.2007 — I would guess that your image path is wrong. Just a guess.

The script you identified uses "pictures/"

Are your pictures in a subdirectory named "pictures"?
Copy linkTweet thisAlerts:
@scott212Apr 17.2007 — I'm thinking a little primer on directory paths is in order...

[U]Examples of [B]absolute paths[/B]*:[/U]

C:myPicturesimage01.jpg

D:folderfile.doc

http://www.mySite.com/images/image01.jpg

*These types of paths should generally be avoided since they are not very portable.

[U]Examples of [B]local paths[/B]:[/U]

If I want my page to get an image that is in the same directory as the page, a simple 'image.jpg' or './image.jpg' will do.

If I want to access an image inside the images folder in the same folder as the page, this will do: images/image.jpg (not /image/image.jpg Starting a path with a slash means your starting at the root of the drive, which is not what we want)

If I want to access an image in the images folder which is in a directory before the one containing the page, you'd do this: ../images/image.jpg


[U][B]Summary:[/B][/U]

../ means to go up or back one directory

./ means the current directory (but is usually unneccessary)

/images means the images folder at the root of the drive (not generally what you want)

images means the 'images' folder that is within the current directory



Best of Luck!
Copy linkTweet thisAlerts:
@rootApr 17.2007 — Paths are Absolute or Relative.

Absolute paths are used for external links outside your site domain, relative paths are "Relative" to the site domain.

/ not only signifies the root of the domain BUT it could easily be a Virtual path, I had Abyss Webserver set up and running so that / would call the virtual directory /php and the index.php file which was in the servers root folder, eg, it was in a folder called PHP next to the htdocs folder and nothing was in the server root.

So beware that / DOES not ALWAYS signify the actual server root, it could just as well be a virtual path.
Copy linkTweet thisAlerts:
@scott212Apr 17.2007 — that is a good distinction
Copy linkTweet thisAlerts:
@bob8611authorApr 17.2007 — In response to Scott212, thank you. It was inside the script where I didn't recogonize a line of script as a path.

I will never understand y script files are posted that are incorrect.?


The script is functioning with one problem way beyond me. I moved the js file to cgi-bin and pics to its own directory. Great!? ?

The menu between the boxes is not showing one option, "Stop Slide Show"

http://webpages.charter.net/robme/jas.htm

I think I attached the file. I can't see any indication from this window of it being attached.

If anyone has the time and ability to correct it, that would be great. I thank you.
Copy linkTweet thisAlerts:
@scott212Apr 17.2007 — It looks like you figured it out because the start/stop works fine for me! Nice job!
Copy linkTweet thisAlerts:
@umd2007Apr 17.2007 — try the old ../jas/jas.js. should work with that! Chris
×

Success!

Help @bob8611 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...