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

  • Home
  • SEARCH
  • 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 8572981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:08:51+00:00 2026-06-11T19:08:51+00:00

I am trying to add a macaddress plugin into my project. but what i

  • 0

I am trying to add a macaddress plugin into my project. but what i got is
“Failed to run constructor: TypeError: Object # has no method ‘addPlugin’ at file:///android_asset/www/javascripts/cordova-2.0.0.js:297 ” from the logchat. Can anybody kowns how can I deal with it to make my plugin work.
I am using plugin from https://github.com/phonegap/phonegap-plugins/tree/master/Android/MacAddress.
In my application.js files, I wrote

    function onLoad() {
        console.log('Init reached');
        document.addEventListener('deviceready', onDeviceReady, false);
    }

    function onDeviceReady() {

        console.log('Starting up...');
    //  navigator.app.overrideBackbutton(true);
        document.addEventListener("backbutton", onBackKeyDown, false);

    }

function getMacAddress(){
    /*get macaddress*/
    var networkInterface = {};
    // Get network interface   
    networkInterface = window.plugins.macaddress.getMacAddress();

    console.log(networkInterface.mac);
    $("#wifi_mac_address").text(networkInterface.mac);   
}

In index.html file, I wrote

<!DOCTYPE html>
<html>
    <head>
        ...
    <script type="text/javascript" charset="utf-8" src="javascripts/cordova-2.0.0.js"></script>
        <script type="text/javascript" charset="utf-8" src="javascripts/application.js"></script>
        <script type="text/javascript" charset="utf-8" src="javascripts/jquery/jquery.mobile-1.1.1.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascripts/MacAddress.js"></script>

   </head>
    <body onload="onLoad()">
         ...

          <li data-theme="c">
                 WiFi mac address:
                 <span id="wifi_mac_address">
                 123
                 </span>
          </li>

         ...
    </body>
</html>

I started phonegap and Jquery mobile for just 3 weeks.Please give me some advices to solve it if you know.
Thanks a lot in advance.

  • 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-11T19:08:52+00:00Added an answer on June 11, 2026 at 7:08 pm

    Your scripts are wrongly placed, when you trying run your mac adress function you haven’t loaded your MacAdress.js, to fix your problem you need to place your scripts like this:

    <script type="text/javascript" charset="utf-8" src="javascripts/cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascripts/jquery/jquery.mobile-1.1.1.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascripts/MacAddress.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascripts/application.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add a class object into a List using reflection, but when invoking
Im new to asp.net mvc. I'm trying add new model class but it got
Trying to add init parameter names to a list in init(ServletConfig) method. public void
Trying to add a blank sample app for a rails tutorial to GitHub, but
Trying to add a 'class' html attribute, but I think the keyword 'class' is
I am trying add on dimension of an array together into a variable using
Im trying to add an ARP binding into ARP table in linux, my arp
I'm trying add vertical lines to my grid. I have found some examples but
Im trying add roles to a drop dropdown box but im getting the error
I'm trying add data triggers to the default combobox style so each text item

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.