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 7506457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:15:58+00:00 2026-05-29T22:15:58+00:00

I wrote a javascript function (already tested it and it works) on a file

  • 0

I wrote a javascript function (already tested it and it works) on a file in a development server and it works just fine, I uploaded the file to the production server and when I test it I get the following error:

Opera Dragonfly says:

Uncaught exception: TypeError: Cannot convert 'App.system.ManageProductLines' to object

Firebug says:

App.system.ManageProductLines is undefined

The files are exactly the same (I checked with WinMerge and found no differences), the only difference is the server on which they’re on.

My development server is the latest version of Xampp on windows and the production server is the latest version of Xampp on OpenSuse.

Does anyone have any idea what’s going on??

Edit:

Suggested by dtryon, here’s some example code:

In main.js

App.system.ManageProductLines = function()
{
     var init_row = function(row)
     {
          //function to add table row behavior
     }

     var reindex_odd_even_rows = function(table)
     {
           //function to reoder table when row is deleted
     }

 }

In index.tpl (Smarty template):

{if $product_lines_url}
    <script type="text/javascript">
        App.system.ManageProductLines.init('manage_product_lines');
    </script>
{/if}

The if in the smarty template is indeed executing, since the final HTML has the script tage in it, however in dev server the function is found, but in production server it isn’t

Edit 2:

Thanks to Paul Butcher I think I’m getting closer to the answer, I tried the following:

<script type="text/javascript">
$(document).ready(function()
{
    App.system.ManageProductLines.init('manage_product_lines');
});
</script>

However it still wouldn’t load, then I tried this:

<script type="text/javascript">
$(document).ready(function()
{
         alert("Start document.ready");

         if(App.system.ManageProductLines.init)
         {
            alert("Method found");
            App.system.ManageProductLines.init('manage_product_lines');
         }
         else
         {
             alert("Method not found");
         }

         alert("End document.ready");
});

According to what I wrote I should get the following alerts:

"Start document.ready", "Method found" || "Method not found", "End document.ready"

The weird thing is I only get "Start document.ready", after that it seems that it just stops executing, both Opera Dragonfly and Firebug show the same error as before.

  • 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-29T22:16:01+00:00Added an answer on May 29, 2026 at 10:16 pm

    At the time this line is reached:

    App.system.ManageProductLines.init('manage_product_lines');
    

    There is no certainty that main.js has been loaded or executed. You need to bind that call to an event that will only occur after all scripts have been loaded.

    If you are using one, most javascript libraries offer such an event (e.g. ready in jQuery). If you are not using one, then binding to onload should work.

    One possible reason for the difference between the two environments may be network latency or load. This is particularly likely if the development server is localhost.

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

Sidebar

Related Questions

I wrote a simple javascript function to display a progressbar with the help of
I wrote the following class in javascript function main() { this.area ; this.$= function(target)
How do I write a Javascript function that accepts a variable number of parameters,
I am trying to write a JavaScript function that will return its first argument(function)
I'm trying to write a javascript function that adds some DOM nodes to the
I am trying to write a javascript function with an if statement that will
I wish to write a simple javascript function that toggles the visibility of a
During my routine work, i happened to write the chained javascript function which is
It is valid JavaScript to write something like this: function example(x) { Here is
I tried to write a function to check key code with JavaScript. It's working

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.