Why doesn't this call the php file I think it should?

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
KenHorse
New php-forum User
New php-forum User
Posts: 18
Joined: Sat Dec 26, 2015 12:18 pm

Mon Jan 11, 2016 4:33 pm

This is just test of something but it should work, right? (yes, jquery.js in the same directory as this php file. And this is also on Linux if that matters)

Code: Select all


<script src="jquery.js"></script>
<script>
function myFunction() {		
       $.GET("otherphpfile.php");
	return false;	
}
</script>

<?php

 print"
 <script>
 myFunction();
 </script>
 ";
 ?>
 

element121
php-forum Fan User
php-forum Fan User
Posts: 606
Joined: Sat Jun 06, 2015 11:46 am
Contact:

Tue Jan 12, 2016 3:34 am

What errors are you seeing in the console?

KenHorse
New php-forum User
New php-forum User
Posts: 18
Joined: Sat Dec 26, 2015 12:18 pm

Tue Jan 12, 2016 8:05 am

None. It just doesn't seem to load the called file

element121
php-forum Fan User
php-forum Fan User
Posts: 606
Joined: Sat Jun 06, 2015 11:46 am
Contact:

Tue Jan 12, 2016 9:46 am

JavaScript is a case-sensitive language (and jQuery), try:

Code: Select all

$.get

KenHorse
New php-forum User
New php-forum User
Posts: 18
Joined: Sat Dec 26, 2015 12:18 pm

Tue Jan 12, 2016 3:51 pm

doesn't make a difference but good catch!

element121
php-forum Fan User
php-forum Fan User
Posts: 606
Joined: Sat Jun 06, 2015 11:46 am
Contact:

Tue Jan 12, 2016 6:06 pm

And still no errors in the console?
Can you see the call in the network tab?

Post Reply