Page 2 of 2

How to change header text programmatically (or link to a REST output)?

Posted: Sat Apr 13, 2013 7:21 pm
by Christine Stringfield

This doesn't seem to work. On my page load I run javascript that says:

$(Tiggzi('mobileHeader')).first().text("new text");

but nothing appears. Is there a different way to do this now?

I also tried

$('h1').first().text("new text");


How to change header text programmatically (or link to a REST output)?

Posted: Sat Apr 13, 2013 7:25 pm
by Christine Stringfield

I guess it didn't like the .first() method for some reason.

I took that out and it worked.


How to change header text programmatically (or link to a REST output)?

Posted: Sat Apr 13, 2013 7:34 pm
by Illya Stepanov

Glad it works!


How to change header text programmatically (or link to a REST output)?

Posted: Tue Apr 16, 2013 7:13 am
by aneguitar

I used this one.
This works if you want to change the header text of a page by just entering the dsid of the Name of the specific header you want to change, by retrieving a local variable.
For example in my case the header Name is "headerCategoryId" and the local variable where I stored the text I wanted to appear in the header is called "categoryName".

($('h1[dsid="headerCategoryId"]').first().text(localStorage.getItem('categoryName')))