Christine Stringfield
Posts: 0
Joined: Wed Apr 03, 2013 4:35 am

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

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");

Christine Stringfield
Posts: 0
Joined: Wed Apr 03, 2013 4:35 am

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

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

I took that out and it worked.

aneguitar
Posts: 0
Joined: Tue Apr 16, 2013 6:51 am

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

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')))

Return to “Issues”