Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using two javascript files

Featured Replies

I have these two javascript files on my HTML page. Only the first javascript file seems to work unless I switch them around and then only the other javascript file works. Is there a way I can get both working on the same HTML page?

 

<script src="js/animated-menu.js" type="text/javascript"></script>

 

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

 

Thank you!

Hi

 

I had this problem in the past and I think it was something to do with the onload event?

I have these two javascript files on my HTML page. Only the first javascript file seems to work unless I switch them around and then only the other javascript file works. Is there a way I can get both working on the same HTML page?

 

<script src="js/animated-menu.js" type="text/javascript"></script>

 

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

 

Thank you!

 

Sounds like they're conflicting. Have you got a link to the site so we can see the scripts in action?

  • Author

Sounds like they're conflicting. Have you got a link to the site so we can see the scripts in action?

 

Yes here it is:

 

My link

 

I've been struggling with this for sometime and I just don't have enough knowledge to fix it. I would really appreciate your help.

Try re-ordering your scripts likes this:

 

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="animated-menu.js" type="text/javascript"></script>
<script type="text/javascript" src="js/interface.js"></script>
<script src="popup.js" type="text/javascript"></script>

 

Also, delete this line:

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

 

You're already loading the jQuery library from googlecode.com so you don't need to do it again.

  • Author

Try re-ordering your scripts likes this:

 

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="animated-menu.js" type="text/javascript"></script>
<script type="text/javascript" src="js/interface.js"></script>
<script src="popup.js" type="text/javascript"></script>

 

Also, delete this line:

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

 

You're already loading the jQuery library from googlecode.com so you don't need to do it again.

 

I have tried your suggestion and the link is updated, but it is still not working. Any more ideas?

I have tried your suggestion and the link is updated, but it is still not working. Any more ideas?

 

It's working fine for my in Firefox and Chrome - no errors at all. What browser are you using?

works fine in IE8 too. Only thing that doesn't work is the top menu opens but doesn't close but it does that in Chrome as well.

Additionally IE8 has some layout issues with the menu.

EDIT *

 

found the problem, i had no closing bracket in the javascript loop lol thats why it all didnt work, i am starting to dislike js more and more each day haha

Edited by web-itec

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.