dialog box wont open a second time

i have
$(document).ready(function() {

    $('#example1').bind('click', function(e) {
        e.preventDefault();
        new $.Zebra_Dialog('<strong>Zebra_Dialog</strong>, a small, compact and highly configurable dialog box plugin for jQuery');
    });

    $('#profile').bind('click', function(e) {
        e.preventDefault();
        new $.Zebra_Dialog('<strong>Some dummy content:</strong><br><br>', {
            source: {'ajax': '../j_social/user_profile.php'},
            width: 800,
            show_close_button: false,
            animation_speed_show: 375,
            animation_speed_hide: 375,
            title:  'Profile External content loaded via AJAX'
        });
         return false;
    });



});

Open in new window


im getting an error of
Uncaught TypeError: undefined is not a function 

Open in new window

for line 10 thats the  new $.Zebra_Dialog line
what am i doing wrong?? how do i fix the ability to open a second time please?
note: again the first round works fine. able to open it and close it fine

thank you in advance for any code or help you may provide.
Johnny
JohnnyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
please provide a link to your page as it work fine here : http://jsfiddle.net/ay5gp5sh/1/
0
JohnnyAuthor Commented:
@leakim971
thx for the reply, and the jsfiddle example.

its not possible for me to display the code on my page its user locked for one and its a private project.

is there anything i can do to get more info on my end?
it works fine in the example i downloaded(i just checked) so this leads me to believe there maybe a conflict some place. im not sure how to track that down if so.

i would really like to get this working as this is exactly what i need in this project.

OH totally forgot im using this as the dialog script
http://stefangabos.ro/jquery/zebra-dialog/
0
leakim971PluritechnicianCommented:
check for error when you click the first time
start from scratch
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

JohnnyAuthor Commented:
ok i redid it some i took the js file i has as i had two doc ready's - and i combined them in the main index.php file.

this fixed the example1 pop up. it now cycles fine

my profile id one still has issues and works fine no errors on the first run the second time you click on the link it gives the error
heres the screen shot
chromes screen shot in counsolechromes screen shot in console

would it be better if i did a close and destroy in the jquery call? (i saw that code someplace but forgot where.
or can i do anything else?
im open to any suggestions to try
0
JohnnyAuthor Commented:
upon reading this ill bet this s whats happening its destroying it
external link removed
0
leakim971PluritechnicianCommented:
put all your scripts in the head section, look like you're loading page and script using ajax
be sure to load the script one time and not just thinking each script will do the work for you
0
JohnnyAuthor Commented:
@leakim971
how can i assign it a var and then use that var to close the dialog please, id have to use new too right
0
JohnnyAuthor Commented:
oh come on now this is getting stupid.

        var dialog1 = new $.Zebra_Dialog('<strong>Some dummy content:</strong><br><br>', {
            source: {'ajax': '../j_social/user_profile.php'},
            width: 800,
            show_close_button: false,
            animation_speed_show: 375,
            animation_speed_hide: 375,
            title:  'Profile External content loaded via AJAX',
            close: function( event, ui ) {
			    //Now call "close"
			    $(this).dialog('close');
		}
        });
    $('#profile').bind('click', function(e) {
        e.preventDefault();
        $dialog1.dialog("open");
    });

Open in new window

now its saying
Uncaught ReferenceError: $dialog1 is not defined

also its opening as the page loads, i assume this is from its assigning the var and running, not even sure if this i the right way right now im doing trial and error to fix this dumb problem
0
JohnnyAuthor Commented:
it seams to me that the example1 dialog works fine and cycles reopens multi times so the other parts work.
when i do my profile one it only opens once does this mean its being destroyed and cant come back??
sorry im getting confused as to how close and destroy work and im perplexed as the example1 works fine and the profile one does not
0
leakim971PluritechnicianCommented:
assign it ? << it >> ? the dialog box ? I don't know.
di you try :

var a = new $.Zebra_Dialog('....
0
JohnnyAuthor Commented:
i found the problem
i was calling an actual stand alone page with reloading jquery and page headers etc.
i took out the ajax call and i worked fine i then uncommitted it and took out all the header and body tags(and stuff in head and it works like a charm now.. go figure

hope this helps someone else and they save the hours i wasted on something stupid
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnnyAuthor Commented:
@leakim971
would you mind if i gave you 100 points as assisted, because your fiddle made me think more about it and show me it worked stand alone?? Id like to accept my "i found the problem" as the solution.

thanks for the help non the less im very grateful for the ball rolling.
0
leakim971PluritechnicianCommented:
'welcome
0
JohnnyAuthor Commented:
Thanks for the help - i gave 100 points for getting the ball rolling as i defined in my ask post if this was ok, i accepted my answer as solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.