help needed for non coder!

This is a discussion on "help needed for non coder!" within the JavaScript Forum section. This forum, and the thread "help needed for non coder! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 1st, 2007, 20:54
New Member
Join Date: Oct 2007
Location: uk
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Angry help needed for non coder!

Hi, I am trying to implement lightbox2 on a site. I have installed all the files, set up a dummy image, included the relevant code in the href but it just opens in a new window. All the files can be found here www.treehuggercards.co.uk/lightbox.htm

any help would be appreciated

Reply With Quote

  #2 (permalink)  
Old Oct 1st, 2007, 21:20
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: help needed for non coder!

The only thing I can think of is that your page is .htm. Try making it .html. It's a long shot but apart from that I cannot see anything wrong and I myself have set up a lightbox. Hmm.

EDIT-Make the script links like they are in the lightbox test page.
Code: Select all
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
 
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
So add in those extra directories. That might work. You never know!

Jack
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #3 (permalink)  
Old Oct 1st, 2007, 21:39
New Member
Join Date: Oct 2007
Location: uk
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help needed for non coder!

Hi, Thanks for the reply.

I have tried changing it to .html without any joy. I have also tried the links with and without the [ js/ ], no joy. I have all the files in the httpdocs folder as i have no access to the actual root on the server, is this the corect location? I removed the [ js/ ] element in the links because I asumed the example had the js files in a different location, however I will try replacing them.

Fingers crossed

UPDATE: No joy with [ js/ ] in the links!
Reply With Quote
  #4 (permalink)  
Old Oct 1st, 2007, 21:43
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: help needed for non coder!

if the JS files are in the root of your website
link like:
/lightbox.js
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #5 (permalink)  
Old Oct 2nd, 2007, 06:37
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: help needed for non coder!

Are you sure that the files are being included? Are you getting any javascript errors? Have you configured everything like it says in the installation guide? (the lightbox version that I use needs a call to the "initLightBox()" funtion in the onload tag of the body...)

Systematic debugging! Eliminate possible errors systematically!
Reply With Quote
  #6 (permalink)  
Old Oct 2nd, 2007, 08:11
New Member
Join Date: Oct 2007
Location: uk
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help needed for non coder!

Quote:
Originally Posted by c010depunkk View Post
Are you sure that the files are being included? Are you getting any javascript errors? Have you configured everything like it says in the installation guide? (the lightbox version that I use needs a call to the "initLightBox()" funtion in the onload tag of the body...)
Answering in order:

I am not sure the files are being included - everyone talks about the [root] of the site, as i am unable to get access to the server root the js files live in a folder called [ js ] which is in the httpdocs folder on the server along with the .css and lightbox.html file. The link from the .html file is constructed thus -<script type="text/javascript" src="js/prototype.js"></script>Is this correct?

I am not getting any javascript errors [i wish] at least then i would know it was talking to the js files!

How do I do the call to the "initLightBox()" funtion in the onload tag of the body? Do I have to add or change anything in the .js files?

Thanks for the help guys
Reply With Quote
  #7 (permalink)  
Old Oct 2nd, 2007, 08:17
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: help needed for non coder!

Quote:
Originally Posted by silverdigit View Post
I am not sure the files are being included - everyone talks about the [root] of the site, as i am unable to get access to the server root the js files live in a folder called [ js ] which is in the httpdocs folder on the server along with the .css and lightbox.html file. The link from the .html file is constructed thus -<script type="text/javascript" src="js/prototype.js"></script>Is this correct?
Well you could try making a simple .js file with one function that outputs an alert:
Code: Select all
function doAlert() {
  alert('Im being included! YAY!');
}
Put it in the same folder as your lightbox files, include it using the same code as you use to include the lightbox files and then call the function to see if it's really being included:
HTML: Select all
<body onload="doAlert();">
See if you get any errors....

Quote:
Originally Posted by silverdigit View Post
How do I do the call to the "initLightBox()" funtion in the onload tag of the body? Do I have to add or change anything in the .js files?
See above. But before you just do that, read the documentation for your lightbox version. Like I said, that's just my version that requires that. I know that some others don't.
Reply With Quote
  #8 (permalink)  
Old Oct 2nd, 2007, 08:54
New Member
Join Date: Oct 2007
Location: uk
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help needed for non coder!

Quote:
Originally Posted by c010depunkk View Post
Well you could try making a simple .js file with one function that outputs an alert:
Code: Select all
function doAlert() {
  alert('Im being included! YAY!');
}
Put it in the same folder as your lightbox files, include it using the same code as you use to include the lightbox files and then call the function to see if it's really being included:
HTML: Select all
<body onload="doAlert();">
See if you get any errors....
First question - which version are you using? I am on v2

I have done the test with same result!

The [js] files are now in a separate [js] folder, so is this path now correct with the .html file in httpdocs:

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

I have also added this

<body onload="initLightbox()">

thanks
Reply With Quote
  #9 (permalink)  
Old Oct 2nd, 2007, 13:34
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: help needed for non coder!

Quote:
Originally Posted by silverdigit View Post
First question - which version are you using? I am on v2
I'm using a modified version of v2....

Quote:
Originally Posted by silverdigit View Post
I have done the test with same result!

The [js] files are now in a separate [js] folder, so is this path now correct with the .html file in httpdocs:

<script type="text/javascript" src="js/prototype.js"></script>
OK, If your file structure looks like this:
Code: Select all
- httpdocs
-- index.html
-- js
--- prototype.js
then the path you are using should be correct.


You could also use an absolute path:
Code: Select all
http://www.yoursite.com/js/prototype.js
Reply With Quote
  #10 (permalink)  
Old Oct 2nd, 2007, 15:38
New Member
Join Date: Oct 2007
Location: uk
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help needed for non coder!

Quote:
Originally Posted by c010depunkk View Post
I'm using a modified version of v2....



OK, If your file structure looks like this:
Code: Select all
- httpdocs
-- index.html
-- js
--- prototype.js
then the path you are using should be correct.


You could also use an absolute path:
Code: Select all
http://www.yoursite.com/js/prototype.js

Well progress if only small!

The test js script gets called when page loads. It is in the same location as the other scripts. Then i moved it to a folder named js and tried again, it failed, so i inserted [ /js ] into the link and it worked. I then inserted the same into the js scripts for lightbox but they still did not work.

So at least i know the path is correct because the test script works which means it has to be something in the javascript?? or do i need to call it in the body tag?

thanks again
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Coder needed . . . ajsiv Job Opportunities 0 Jan 25th, 2007 19:32
php coder needed!!! iceman Job Opportunities 0 Aug 2nd, 2006 15:09
php coder needed iceman PHP Forum 0 Aug 2nd, 2006 15:03
php coder needed iceman Introduce Yourself 1 Aug 2nd, 2006 00:53
Needed Coder. Ashleigh04 PHP Forum 0 Jun 14th, 2006 19:09


All times are GMT. The time now is 22:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43