WordPress.org

Ready to get started?Download WordPress

Forums

Problem with ajax (1 post)

  1. frih
    Member
    Posted 4 years ago #

    Hello,

    i have created a ajax based slideshow to show the images and i have added the Javascript code in the index.php file of the theme template.

    But whenever i run my site it shows PHP 404 object not found error.

    Here is the JS code--

    xmlhttp.open('GET','test.php?img_id=0');
    	xmlhttp.send(null);
    
    	xmlhttp.onreadystatechange=function(){
    		if(xmlhttp.readyState==4)
    		{
    			document.getElementById('flash').innerHTML=xmlhttp.responseText;
    		}
    	}

    I have included the javascript code on index.php theme file---

    <script type="text/javascript" src="<?php
    bloginfo('template_directory')?>/runmefile.js"> </script>
    	<title>Untitled 2</title>

    runmefile.js is the file that holds that above ajax code.

    test.php is the file which creates the animation. The file is present in the theme directory but it is still showing 404 error.

    I am testing it on localhost, i dont have any site.

    need help....

    Is there any other way to call the that PHP file(test.php)???

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags