Solved

Javascript error

Posted on 2014-04-16
5
309 Views
Last Modified: 2014-04-29
I downloaded a script called Thumbnail gallery with PHP admin.  When I load it and go to the admin page, I get an error:

TypeError: $jDOPTG(...).attr(...) is undefined
      
var id = $jDOPTG(this).attr('id').split('-')[2];

The following, is the entire function:
function doptgGalleriesEvents(){// Init Gallery Events.
    $jDOPTG('li', '.column1', '.DOPTG-admin').click(function(){
        if (clearClick){
            var id = $jDOPTG(this).attr('id').split('-')[2];
            
            if (currGallery != id){
                currGallery = id;
                $jDOPTG('li', '.column1', '.DOPTG-admin').removeClass('item-selected');
                $jDOPTG(this).addClass('item-selected');
                doptgShowImages(id);
            }
        }
    });
}

Open in new window


Any clues on how to fix this?
0
Comment
Question by:rgranlund
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 40003951
can you include the download link where you got it ?
0
 
LVL 7

Author Comment

by:rgranlund
ID: 40003975
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40003985
so this is something you purchased ?
0
 
LVL 7

Author Comment

by:rgranlund
ID: 40004014
The error seems to have disappeared!
0
 
LVL 53

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 40004015
Make sure you are loading the JQuery library and then try adding this to the top of your script but after the JQuery script include

var $jDOPTG = jQuery.noConflict();

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now