Solved

Javascript error

Posted on 2014-04-16
5
310 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 54

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
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