SimplePortal
Customization => Custom Coding => Topic started by: phantomm on February 28, 2013, 10:18:03 AM
-
Hi, so I've been trying to make something like this:
If there is new shout in SP Shoutbox forum title would be changed to "New shout!", but when you visit tab/window with this shourbox it should be changed to default forum title.
I know how and where* use document.title = 'New shout!';. Problem is how to reset forum title to default after visiting page, without need to refresh whole page?
* - you need to add document.title before this code in portal.js
}
setInnerHTML(document.getElementById('shouts_' + shoutbox_id), new_body);
-
phantomm,
Imo use DOM or javascript.
Here it is using javascript:
echo '<script type="text/javascript">
document.title = "New Page Title";
</script>';
-
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.
-
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.
phantomm,
My apologies for the late reply as I am working on a project as of late.
I have not tested it but you put what I posted in a js function & have it execute the function when the shout button or ie. onkeydown keycode 13 (return/enter) is executed if I understand you correctly.
echo '<script type="text/javascript">
onLoad = function changeTitle() {
document.title = "New Page Title";
}
</script>';
.. then in the js for what I mentioned prior you execute changeTitle()