Hello. I start to learn jQuery and AJAX. Wrote the function for the parser. In which you need to pass an ID as a parameter to a PHP file using an AJAX. And at the exit, parse the contents of the XML file by fields. Here is her script:
<script type="text/javascript"> function kp_info ( ) { var url = document.getElementById("kp_url").value; ShowLoading(""); $.ajax({ type: "POST", url: "engine/ajax/kp_parser.php", data: "url="+url, dataType: "xml", success: function(xml) { jQuery(xml).find("site").each( function() { year = jQuery(this).find("year").text(), actors = jQuery(this).find("actors").text(); ganre = jQuery(this).find("ganre").text(); descr = jQuery(this).find("descr").text(); director = jQuery(this).find("director").text(); name = jQuery(this).find("name").text(); or_name = jQuery(this).find("or_name").text(); $('#name').val(name); $('#year').val(year); $('#or_name').val(or_name); $('#ganre').val(ganre); $('#director').val(director); $('#actors').append(actors); $('#descr').append(descr); } ); } }); HideLoading(""); return false; } </script>
This script works in the old version of Opera, but in modern browsers it refuses to do. In the chrome console produces the following:
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Please tell me how to bring it to work in all browsers. If necessary, I can pay.