Solved

TopUp - Javascript

Posted on 2010-11-11
34
1,393 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:JohnMac328
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 16
  • 12
  • 5
34 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 total points
ID: 34113995
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
 

Author Comment

by:JohnMac328
ID: 34114093
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34114116
I need to see some code on a real website.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JohnMac328
ID: 34114125
That's what I would like, an example of a local path working.
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34115236
<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
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34115246
<script type="text/javascript" src="./js/top_up-min.js"></script>
This may also work fine
0
 

Author Comment

by:JohnMac328
ID: 34115293
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
 

Author Comment

by:JohnMac328
ID: 34115531
This also did not work
<script type="text/javascript" src="http://localhost/Intranet_Pop_Up_Test/js/top_up-min.js"></script>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34115815
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
 

Author Comment

by:JohnMac328
ID: 34115891
No change - here is the folder structure - the images and js
Example.jpg
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34115902
did u tried in the second way i given
0
 

Author Comment

by:JohnMac328
ID: 34115930
Yes
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34115948
try this also
src="~/js/top_up-min.js"
0
 

Author Comment

by:JohnMac328
ID: 34115973
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
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34116007
r u sure that this file is in this folder?
0
 

Author Comment

by:JohnMac328
ID: 34116044
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
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34116333
so where is this html file
0
 

Author Comment

by:JohnMac328
ID: 34116353
It is in the root of the image I sent
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34116409
0
 

Author Comment

by:JohnMac328
ID: 34116441
I may try it at home, something is not right.
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34116459
are u using an IDE
0
 

Author Comment

by:JohnMac328
ID: 34116471
Not sure what you mean
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34116596
what is the server language u are using
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34116635
Does that matter at all???
Just uploaded the unzipped file to my server. All works as expected.
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34117341
ok r u using an ide like dreamviewer or visual studio or something like that
0
 

Author Comment

by:JohnMac328
ID: 34119968
Using Dreamweaver - Looking for another place to test it since I was not able to at home.
0
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34120107
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
 

Author Comment

by:JohnMac328
ID: 34120132
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
 
LVL 7

Assisted Solution

by:wdfdo1986
wdfdo1986 earned 250 total points
ID: 34120312
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
 

Author Comment

by:JohnMac328
ID: 34120335
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
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 34120370
Sorry I am out of solutions now
To proceed i need some screen shots of the site if u can
0
 

Author Comment

by:JohnMac328
ID: 34120380
Let me test it on another machine to see if I get the same result.
0
 

Author Closing Comment

by:JohnMac328
ID: 34137101
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question