I have a page containing tabs that are generated through a loop.
Each iteration through the loop the tab contains several links that preform functions specific to the contents of that tab (chat pages)
I have a function in PHP that gathers all of the chat messages for a given tab and smooshes (technical term :P) them together and dumps them into a js function which in turn allows the transcript to be copied to the clipboard with a single button click. The problem I am running into is that when I issue:
the page shows an error in the status bar: javascript:doit (
The page also displays the contents of the string as a link "somerandomtext )>"
it looks as if the php script is stopping after the ? in the ?> closing tag.
I can pass another variable in the same script via an echo to js and it stays hidden on the page and allows the function to work.
I think there is something in this string that needs to be removed (a special char or tag) but I am at a loss as to what would be in there.
The transcript is gathered from a database that inserts
into the string in a loop until all lines are processed.
I have tried removing all of the HTML tags in the string before passing it to the js function and that didn't resolve the issue with the braces staying open.
Each iteration through the loop the tab contains several links that preform functions specific to the contents of that tab (chat pages)
I have a function in PHP that gathers all of the chat messages for a given tab and smooshes (technical term :P) them together and dumps them into a js function which in turn allows the transcript to be copied to the clipboard with a single button click. The problem I am running into is that when I issue:
Code:
<a href=javascript:doit(<?PHP Echo $tscript; ?>)><img src=button.gif> /a>
The page also displays the contents of the string as a link "somerandomtext )>"
it looks as if the php script is stopping after the ? in the ?> closing tag.
I can pass another variable in the same script via an echo to js and it stays hidden on the page and allows the function to work.
I think there is something in this string that needs to be removed (a special char or tag) but I am at a loss as to what would be in there.
The transcript is gathered from a database that inserts
Code:
<b>speaker: </b> text from the query return <br>
I have tried removing all of the HTML tags in the string before passing it to the js function and that didn't resolve the issue with the braces staying open.
Comment