Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6107369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:10:52+00:00 2026-05-23T14:10:52+00:00

I have a bit of a weird problem that I can’t seem to resolve.

  • 0

I have a bit of a weird problem that I can’t seem to resolve. I’m trying to call a javascript function from a file outside of my smarty template directory and it doesn’t seem to be working. In my smarty file, I have:

<script type='text/javascript' src= '../functions/editConcert.js'></script>
<form>
<input type="button" value="Edit Info" onclick="editInfo();">
</form>

And in my editConcert.js file, I have (for testing purposes):

function editInfo(){
     alert("I get here");
}

My directory structure looks like this:

Classes
    -FillConcertInfo.php (this calls the smarty display function)
Templates
    -editConcert.tpl
Javascript
    -editConcert.js 

I cannot for the life of me figure out what’s going on. It works fine in a normal php/html page but smarty seems to be throwing it out the wayside. Any help would be much appreciated.

EDIT: It should be worth noting that adding the following to my smarty template works, but I’d like to use an external file:

{literal}
<script>
function editInfo(){
    alert("I get here");
}
</script>
{/literal}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:10:53+00:00Added an answer on May 23, 2026 at 2:10 pm

    Smarty does not affect the loading of external resources sent to the client, as they are requested by the client. Adding the javascript in the template works because then the function is defined where a broken link to an external resource would have the function be undefined.

    Open Firebug/Chrome inspector and look at the network information and see if the external javascript page is being loaded or, most likely, has a status of 404. Check your directories and that should fix the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of a problem that I can't seem to code my
I have a bit of a weird problem. I developed an app with MVC
all. I'm having a bit of weird problem with client server program. I have
Ok I have a bit of a weird scenario, and I can't change the
I have a bit of a strange problem. I have a music app that
I have a weird problem building a release of an erlang application that I'm
This is a little bit of weird problem here. Say I have a C++
I have a bit of a weird problem. I have a form with a
I have kind of a weird problem .. Something that isn't working on ff
I'm having a bit of a problem with a very weird side effect that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.