0

I'm trying to change original title of the web page with another title using jQuery like this:

<script type="text/javascript">
    $(function(){
        var newTitle = "The New Title";
        $("title").text(newTitle);
    });
</script>

This snippet of code works pretty fine on Google Chrome and Firefox but doesn't work on IE8 (which I've tested on), So what's wrong?!

And another related question: if I used this way to change title of the web page, then which title of them (original or new) google and other search engines will use in their indexing process?

Amr
  • 4,809
  • 6
  • 46
  • 60

1 Answers1

1

Instead of using jquery, plain javascript will work in your case,

 document.title = "The New Title";
maximus ツ
  • 7,949
  • 3
  • 25
  • 54