I have a site we needed some custom php coding to connect to an external database to grab product review urls for several vendors that sell our products. The basic idea we are trying to accomplish is to have the user register their product and then extend their warranty if they are willing to leave a review. I'm using xyzscripts.com's "Insert PHP" plugin to accomplish this. The theme initially had only jQuery loaded so as to keep from creating a child theme we are loading jQueryUI in the php script. So we have jQuery loaded in the header and jQueryUI loaded in the body of the document. Im not quite sure if this is being caused because of the order the scripts are being loaded or if some other conflicting javascript is causing the error. You can see the error in the image below.
Chrome's Console Output On Calling The Dialog
Relevant Code
<script>
jQuery.ajax({
type: 'GET',
url: "<?=$ajax_handler?>?method=check_warranty&model="+model,
success: function(response) {
if (response == '')
duration = '6';
else
duration = response;
jQuery('#warranty_length').val(duration);
jQuery('#warranty_dialog').dialog({
width:'700px',
height:'408px',
position:'absolute',
top:'300px'
}).html("HTML TO DISPLAY REVIEW LINK BUTTON");
jQuery('.titlebar-close').hide();
}
});
</script>
As you can see the code is pretty straightforward. After the user fills out the form I make an ajax call that queries our database with the Model and Vendor to get the appropriate review link for that product and then creates a link to the review page for that Vendor and Model.
I'm trying to determine if the error is being caused by one of three things.
- There is an issue with the order jQuery & jQueryUI are being loaded.
- There is an issue with my code (I have successfully used this script on some of our other sites).
- If there's possibly other javascript in the theme that is conflicting with my script.
I can provide any other relevant code you need on the php script if necessary. The url to page is:
http://www.kriegermfg.com/register-test/
Any help will be greatly appreciated.
Edit Just to give some further context this is jQueryUI is failing.