Copy link to clipboard
Copied
I typed this code to call a Javascript from one of two possible locations:
<script
src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
</script>
<script
src="../feedback_script.js" language=javascript type="text/javascript"
style="x-condition: Online;"</script>
However on the first call, RH changes it to the following once I click out of HTML or navigate away from the topic:
<script
src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
</script>
<script
src="../feedback_script.js" language=javascript type="text/javascript"
style="x-condition: Online;"</script>
Notice that the closing tag, </script>, has been replaced as </script>.
This breaks the calling statement. Anywone know why RH is doing this and how to make my code "stick"?
Thanks,
Jared Hess
RH 7.0.3.001
Win32 Vista
HTMl Help Output
Oh, I missed it the first time too. I've coloured and bolded the missing part of the tag as per William's post. I tried it in RH6 and RH7 and the code isn't changed when the missing bracket is included.
<script src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
<script src="../feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
Copy link to clipboard
Copied
Hi,
Embed all tags in < and >. RoboHelp replaces the second <, because it wants to close thet <script tag. You code should work if you use it as following:
<script>
src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
</script>
<script>
src="../feedback_script.js" language=javascript type="text/javascript"
style="x-condition: Online;"
</script>
Greets,
Willam
Copy link to clipboard
Copied
I don't think that will work, as src, type, etc are attributes of the script tag, not the script code itself, and must be within the opening script tag.
However, I did find a page that says script doesn't support standard attributes, such as lang and style. So you might try removing those attributes and see if RH still plays with the brackets. Alos, possibly putting the type earlier might help (it shouldn't make a difference, but sometimes these things do).
http://www.w3schools.com/TAGS/tag_script.asp
Amebr
Copy link to clipboard
Copied
Ahh, my bad... Didn't pay enough attention, it should be like this:
<script src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
<script src="../feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
I'n not sure about the style attribute though, but it probably won't do any harm.
Greet,
Willam
Copy link to clipboard
Copied
JavaScript tends to balk at tabs and line breaks that are in the code, which is usually inherent when you copy the script that has some word wrapping and tabs in it. Those breaks, unfortunately, are interpreted as such when you paste it into your topic's html code.
It's always best to "scrub" the code thru Notepad. That is:
Note that RH will turn that script into "human-readable" code (maybe identical to what you started with in step 1) with tabs and line breaks, but that's OK. Since it "knows" about those breaks, it will "read" that JavaScript code correctly.
Good luck,
Leon
Copy link to clipboard
Copied
Oh, I missed it the first time too. I've coloured and bolded the missing part of the tag as per William's post. I tried it in RH6 and RH7 and the code isn't changed when the missing bracket is included.
<script src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
<script src="../feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>
Copy link to clipboard
Copied
Thanks Amebr. I suppose I was missing the closing right angle brackets > there. I didn't notice them until you pointed it out... I was wondering what everyone else was talking about... Blind as a bat I suppose. So chalk this one up to user error then. It certainly won't be the first time (or the last unfortunately).
Jared
Copy link to clipboard
Copied
Thanks everyone for your help. I tried MergeThis's suggestion, but that didn't work either... at least the < kept changing.
After some more testing, seems that if I use the Insert | HTML | Advanced | Script menu item and use the dialog box to insert the script it keeps the < symbol intact. Wish I could just use the HTML Editor like an editor and just paste and type my HTML like I desired w/o RH messing with it. But oh well guess you can't have your cake and eat it too...