URL problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

URL problem

Postby ck330 » 24. March 2011 05:42

Hi, I have problem when I test program in XAMPP (Lite 1.7.3) and Windows XP.

The test.php refreshes a new random number every 10 seconds from count.php. It works well when 2 files is located in local server, but it cannot refreshes a new random number if test.php is located in local server and count.php file is located in web hosting server (not local server).

I've searched the solution and try to test it again and again; including edit php.ini "allow_url_include = On", but it also cannot refresh a new number. Please help me, thank you!

test.php
Code: Select all
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(function() {
   $('#load_num').fadeOut('fast').load('http://www.abc.com/count.php').fadeIn("fast");
}, 10000);
</script>
</head>
<body>

<div id="load_num">7</div>

</body>
</html>


count.php
Code: Select all
<?PHP
echo rand(5, 15);
?>
ck330
 
Posts: 2
Joined: 24. March 2011 05:16

Re: URL problem

Postby Sharley » 24. March 2011 06:13

Code: Select all
<script></script>
Tells the server or the browser nothing, it is an incorrect tag that requires a script 'type' attribute, but not sure until you correct it if it is related to your issue.
Code: Select all
<script type="text/javascript"></script>
would be a very simple correction but read the manual about HTML tags to get the full picture and http://validator.w3.org/#validate_by_input may be a good place to start for check out your code for correctness (I see a few errors in red when I copy and paste your code in the link above).
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: URL problem

Postby ck330 » 04. April 2011 14:25

Sharley wrote:
Code: Select all
<script></script>
Tells the server or the browser nothing, it is an incorrect tag that requires a script 'type' attribute, but not sure until you correct it if it is related to your issue.
Code: Select all
<script type="text/javascript"></script>
would be a very simple correction but read the manual about HTML tags to get the full picture and http://validator.w3.org/#validate_by_input may be a good place to start for check out your code for correctness (I see a few errors in red when I copy and paste your code in the link above).


The problem may be that jQuery does not allow cross domain.

Thank you, Sharley!
ck330
 
Posts: 2
Joined: 24. March 2011 05:16


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 147 guests