Jump to content

PHP and jQuery


afish674
 Share

Recommended Posts

I've just started learning PHP and have a quick question regarding compatibility with jQuery. I noticed that PHP uses the "$" sign to set variables. This would seem to cause a compatibility clash with jQuery as it also uses the "$" sign for functions etc. My question is: If you want to use both on the same page together do you need to re-assign jQueries "$"? or if you use external script files would that get around the problem? Thanks.

Link to comment
Share on other sites

jQuery is a JavaScript library, not a PHP library.By the time JavaScript starts running, PHP is already finished, so there's no conflict. In fact, there's no way you could use JavaScript to get the source of the PHP file that generated the page. Not without the server's cooperation I mean.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...