jqueryajaxsmart-wizard

jQuery ajax: loading html + applying plugin, ie7


I have a part of a page that i want to load using ajax. The content is the html for this wizard: http://techlaboratory.net/labs/SmartWizard2/index.htm

What im currently doing:

$(function(){

    $.ajax({
        url: 'content.htm',
        dataType: 'html',
        success: function(data) {

            $('#content').html(data);

            $('#wizard').smartWizard({

            //#wizard is inside the #content

                transitionEffect:'fade', 
                onFinish: function() { 
                    alert('finishClicked');
                } 

            });


        }
    });

});    

The script works fine if i just use $('#wizard').smartWizard(), and keep everything on the same page. But when im loading with ajax it doesnt work. Could anyone tell me the difference? Any ideas how to solve? Thanks


Solution

  • you cannot do ajax requests on different domains due to the Same Origin Policy

    There are a few solutions to overcoming this. Take a look through here: https://stackoverflow.com/search?q=Same+Origin+Policy