TopUp - Javascript

I am trying to get TopUp to work with a local path.  When I use

 <script type="text/javascript" src="http://gettopup.com/releases/latest/top_up-min.js"></script>
it works fine but when I try <script type="text/javascript" src="js/top_up-min.js"></script> it does not.  I have included the complete code that is from the http://gettopup.com site.

Any help is appreciated
<script type="text/javascript" src="http://gettopup.com/releases/latest/top_up-min.js"></script> 

<script type="text/javascript">
  TopUp.host = "http://localhost/";
  TopUp.images_path = "images/top_up/";
</script> 
<script type="text/javascript">
  TopUp.host = "http://localhost/";
  TopUp.players_path = "images/players/";
</script> --->

Open in new window

JohnMac328Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
how about
<script type="text/javascript" src="js/top_up-min.js"></script>

<script type="text/javascript">
  TopUp.images_path = "images/top_up/";
TopUp.players_path = "images/players/";
</script>

or not setting this at all  since

   At default, TopUp assumes that the images reside at the same host as the file itself in the following path /images/top_up/.     You can change the path (and even the host) by changing the variables TopUp.host and TopUp.images_path as the following...

http://gettopup.com/documentation
0
 
JohnMac328Author Commented:
Done all that - In my question I state that <script type="text/javascript" src="js/top_up-min.js"></script> does not work.  I did not add this
<script type="text/javascript">
 TopUp.images_path = "images/top_up/";
TopUp.players_path = "images/players/";
</script>

at first, I added it to try and get it working.  His example that is downloaded has the link going to his site, there is no working example of a local path.
0
 
Michel PlungjanIT ExpertCommented:
I need to see some code on a real website.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
JohnMac328Author Commented:
That's what I would like, an example of a local path working.
0
 
wdfdo1986Commented:
<script type="text/javascript" src="<root_folder>/js/top_up-min.js"></script>
works fine to me
<root_folder> is the root folder that contains ur website
0
 
wdfdo1986Commented:
<script type="text/javascript" src="./js/top_up-min.js"></script>
This may also work fine
0
 
JohnMac328Author Commented:
Here is the path


<script type="text/javascript" src="Intranet_Pop_Up_Test/js/top_up-min.js"></script>

Still does not work, could you post your example so I can see what I am missing?
0
 
JohnMac328Author Commented:
This also did not work
<script type="text/javascript" src="http://localhost/Intranet_Pop_Up_Test/js/top_up-min.js"></script>
0
 
Michel PlungjanIT ExpertCommented:
Please forget localhost.

If you load the page and the javascript and images are on a relative (images/)  or absolute (/images) path on the same server, you do NOT need the host
0
 
JohnMac328Author Commented:
No change - here is the folder structure - the images and js
Example.jpg
0
 
wdfdo1986Commented:
did u tried in the second way i given
0
 
JohnMac328Author Commented:
Yes
0
 
wdfdo1986Commented:
try this also
src="~/js/top_up-min.js"
0
 
JohnMac328Author Commented:
No - the paths are correct.  I wish his example would have been setup as a local like all the others.  Who wants to link to a site that will go down some day.
0
 
wdfdo1986Commented:
r u sure that this file is in this folder?
0
 
JohnMac328Author Commented:
Checked several times - copied and recopied them over and over.  I had no problem with shadowbox as far as paths etc.  It just looks like crap.
0
 
wdfdo1986Commented:
so where is this html file
0
 
JohnMac328Author Commented:
It is in the root of the image I sent
0
 
Michel PlungjanIT ExpertCommented:
0
 
JohnMac328Author Commented:
I may try it at home, something is not right.
0
 
wdfdo1986Commented:
are u using an IDE
0
 
JohnMac328Author Commented:
Not sure what you mean
0
 
wdfdo1986Commented:
what is the server language u are using
0
 
Michel PlungjanIT ExpertCommented:
Does that matter at all???
Just uploaded the unzipped file to my server. All works as expected.
0
 
wdfdo1986Commented:
ok r u using an ide like dreamviewer or visual studio or something like that
0
 
JohnMac328Author Commented:
Using Dreamweaver - Looking for another place to test it since I was not able to at home.
0
 
wdfdo1986Commented:
in dreamweiver if u "src=" and press Ctrl+Space then u can browse for the file and it will make the relative path for u.
0
 
JohnMac328Author Commented:
I tried it just for the heck of it but it is the same path.  My paths are correct, something is preventing it - I have many other *.js files in the js folder, could be a conflict.
0
 
wdfdo1986Connect With a Mentor Commented:
cant be something like that
try loading the page with IE
then u can see the javascript error
read it and post it here
0
 
JohnMac328Author Commented:
Does not give an error, just opens the link in a new page instead of the popup window.  I am opening a link not an image.
0
 
wdfdo1986Commented:
Sorry I am out of solutions now
To proceed i need some screen shots of the site if u can
0
 
JohnMac328Author Commented:
Let me test it on another machine to see if I get the same result.
0
 
JohnMac328Author Commented:
For some reason remaning  js to javascript made the difference.  I know, makes no sense.

<script type="text/javascript" src="javascript/top_up-min.js"></script>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.