can i use javascript and jquery both in a page?
like:
<script type="text/javascript">
$(document).ready(function(){
//some jquery
});
function xyz(){
//javascript statements
//some jquery statements
}
</script>
can i use javascript and jquery both in a page?
like:
<script type="text/javascript">
$(document).ready(function(){
//some jquery
});
function xyz(){
//javascript statements
//some jquery statements
}
</script>
Yes. jQuery is JavaScript. jQuery simply provides some very convenient functions that takes care of some of the pain of writing JavaScript.
jQuery == javascript
so Yes, javascript functions can co-exist with jQuery functions, just use the correct namespace for the function you want to call...
jQuery is a Javascript library so whenever you're using it on a page, you're already using Javascript. So yes, you can.
Yes they can coz both are basically same. Jquery is just a framework of javascript; so no problem there :)
Yes, jQuery is a library that provides more out-of-the-box functionality, but it's still Javascript.
You'll still be able to use the base language if you choose. Be aware that jQuery will afford you many opportunities to refactor existing code for brevity and maintainability.
Also jQuery is written in an anonymous scoop. Which means that you even can call your functions the same thing since all jQuery's functions (methods) is under the jQuery namespace.
Ie.
//In jQuery there's a method called "extend"
$.extend( obj : newObj);
// This can co-exists with you own global "extend" method
function extend () {
//do stuff
}
..fredrik