Solved

Javascript error

Posted on 2014-04-16
5
305 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
Comment Utility
can you include the download link where you got it ?
0
 
LVL 7

Author Comment

by:rgranlund
Comment Utility
0
 
LVL 22

Expert Comment

by:plusone3055
Comment Utility
so this is something you purchased ?
0
 
LVL 7

Author Comment

by:rgranlund
Comment Utility
The error seems to have disappeared!
0
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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…

772 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

15 Experts available now in Live!

Get 1:1 Help Now