Question

I am using jquery for focus of tabs. When i used :

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>

in my jsp then the window.load function works good, but when i downloaded jquery.min.js and added in js folder.

<script type="text/javascript" src="jquery.min.js"></script> like this.

Now window.load function is not working.

<script type="text/javascript">

$(window).load(function() {
    alert('Hello');
    if($("#updatetemp").val()=="TRUE"){
    $("#update_link").click();}
    });

</script>
Was it helpful?

Solution

I found out the way to use JQuery locally..

jQuery(window).bind("load", function($) {
    var msgtemp= jQuery("#updatetemp").val();

    if(msgtemp=="TRUE"){
    jQuery("#update_link").click(function() {
        }).click();
    }
});

Instead if $ symbol i just used jQuery attribute and it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top