Wednesday 15 July 2015

Execute javascript only in specific url -


I have an external JS file inside this code:

  var mobile_number_perm = document GetElementById ('mobile_number_param'); Mobile_number_param.maxLength = 9; Mobile_number_param.readOnly = True; Var email = document.getElementById ('email'); Email.readOnly = true; Var user_notes = document.getElementById ('user_notes'); User_notes.maxLength = 90; Var admin_notes = document.getElementById ('admin_notes'); Admin_notes.maxLength = 90;   

Now my goal is to implement the code related to "mobile_number_param", but only when I am on the "reserved.fp" page otherwise I do not have permission to modify my mobile phone number My profile page in other area.

Someone told me this:


You can identify the current URL by checking the window.location.href reserved.FPP to search for know that you Reservation page. Then apply your code.


Unfortunately I am not a codeer and I have no idea how to do it. / P>

Any suggestions? Thank you for your time ...

  if (window.location.href.indexOf ( 'Reserved.fp')! = -1) {// Reserved .fif content here}}    

No comments:

Post a Comment