Question

I've been handed a role administering a SharePoint site, and the following custom code is on one of the pages:

<script type="text/javascript">
 $(document).ready(function() {
      $("#pgtitle").html("Customer Service Feedback");
       });

</script

I'm not a javascript guy, so I'm having trouble interpreting this. The code was written by someone who is no longer with my firm, and left well before I arrived.

Était-ce utile?

La solution

$(document).ready(function() means that the code that follows, will start as soon as the page has loaded.

$("#pgtitle").html("Customer Service Feedback"); simply passes the value Customer Service Feedback to the HTML element pgtitle.

if you look on the page for the pgtitle element, I'm sure you will see it contains the text Customer Service Feedback ! :)

Autres conseils

It sets text on the element of id = pgtitle as soon as the DOM document had fully loaded. In human language it manually sets the value of some title.

Have a look at the JQuery library for the "html" method and if you look for the id that is called "pgtitle" you will find the html that is effected.

Source:http://api.jquery.com/html/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top