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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:05:10+00:00 2026-06-04T13:05:10+00:00

I am using Phonegap and JQueryMobile to create a web application. I’m new to

  • 0

I am using Phonegap and JQueryMobile to create a web application. I’m new to javascript and am having an issue.

My issue is with calling a function I have in a file named “testscript.js”, the function is called testFunc. The testscript.js containts only this:

function testFunc() {
    console.log("Yes I work");
}

Within my html page I have the following code:

<script>
  $('#pageListener').live('pageinit', function(event) 
    {
     testFunc();
    });
</script>

The test function is found within my “testscript.js” which I am including with this line within the head tags:

<script src="testscript.js"></script>

The error I get is a “testFunc is not defined”.

I am assuming its some type of scope issue as I’m able to call other jquery functions such as:

alert("I work");

and I am able to call my functions by sticking them within script tags in the html elsewhere.

I’ve tried all sorts of ways of calling my function with no success, any help is appreciated!

  • 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-06-04T13:05:11+00:00Added an answer on June 4, 2026 at 1:05 pm

    You must include the testscript.js before the other jquery code in your html. Like this:

    <script src="testscript.js"></script>
    
    <script>
       $('#pageListener').live('pageinit', function(event) 
       {
          testFunc();
       });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that is using jquery, jquerymobile and spine.js running on phonegap
right now i have this code using phonegap and jquerymobile $( '#user_detail' ).live( 'pageinit',function(event)
I have an application made by using phonegap 1.5.0 and jquery mobile 1.1.0.... I
I am using phoneGap framework to create mobile application . and i am putting
I am developing application using phonegap in eclipse for android .I have created folder
I am developing a mobile application using phonegap and jquery mobile. I have this
Guys I have this peace of code I'm using phonegap with jqueryMobile to develop
I have a mobile web application built using the following versions :- JQuery Mobile
I have a mobile app that I developed using PhoneGap (and html/css/javascript) and there
I have already built my web pages using jQueryMobile and ASP.NET MVC framework. Now,

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.