mam taki kod:
$base = home_url();
Generalnie wszystko chodzi super dopóki zapytanie nie jest ajaxowe. Gdy leci prez XMLHttpRequest przeglądarka po prostu się zawiesza.
Nie wiem w czym problem a nigdzie nie znalazłem pomocy. Ma ktoś jakiś pomysł?
$base = home_url();
<?php }else{ ?> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(function(){ $('button').click(function(){ $.ajax({ url: 'index.php?img', success: function(url){ $('body').append('<img src="'+url+'" />'); } }); }); }); </script> <button>Zaladuj obraz</button> <?php }
<?php if($_SERVER["HTTP_X_REQUESTED_WITH"] == 'XMLHttpRequest') { if (have_posts()) : while (have_posts()) : the_post(); $base = home_url(); ?> <?php endwhile; endif; }else { ?> <?php get_header();?> <?php foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <section id="header-image"> </section> <section id="single-title"> <h2 class="single"> <?php $parent_title = get_the_title($post->post_parent); ?> </h2> (...................)