Do not run event in just one page

2

I have the following code on every page

$( ":submit" ).click(function() {
		  $("#escondido").css("display","block");
		});

This code is in a blabla.js file, and is included with php at the top of every page of the site, but in just one page I do not want this event to occur, there is the possibility to disable it only on this page without have to remove the blabla.js

    
asked by anonymous 13.10.2016 / 19:59

2 answers

1

In the page to which I do not want to show the div. put it in an event

$("#escondido").css("visibility","hidden");

So it "Runs" more is not visible.

    
13.10.2016 / 20:19
1

You can use the hide () function of JQuery:

$( ":submit" ).click(function() { 
    $("#escondido").hide();
 });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><divid='escondido'>Escondido</div><inputtype='submit'value="Submit"/>
    
13.10.2016 / 21:25