Page 1 of 1

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

Posted: Mon Jan 11, 2016 4:33 pm
by KenHorse
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>
 ";
 ?>
 

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

Posted: Tue Jan 12, 2016 3:34 am
by element121
What errors are you seeing in the console?

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

Posted: Tue Jan 12, 2016 8:05 am
by KenHorse
None. It just doesn't seem to load the called file

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

Posted: Tue Jan 12, 2016 9:46 am
by element121
JavaScript is a case-sensitive language (and jQuery), try:

Code: Select all

$.get

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

Posted: Tue Jan 12, 2016 3:51 pm
by KenHorse
doesn't make a difference but good catch!

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

Posted: Tue Jan 12, 2016 6:06 pm
by element121
And still no errors in the console?
Can you see the call in the network tab?