• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Baby steps - combining Javascript and HTML in RH7

Explorer ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

Help, please!

I know nothing about HTML programming, and I have several small links I would like to use with Javascript code.

This is one link for the user to click on:

<p style="font-size: 8pt; text-align: center;" align=center>Print this
page</td>

I have this little piece of Javascript:

<a href="javascript:window.print()">Print this page</a>

How do I put the two together?

I don't have time to learn HTML - I need to get this working by tomorrow!

Thanks for any help...

Views

783

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Oct 20, 2009 Oct 20, 2009

Hi there

Interesting that you say you don't know anything about HTML or JavaScript, then post the HTML code and the JavaScript code!

I suppose if you want to do it the HTML way, the new code would look something like this:

<p style="font-size: 8pt; text-align: center;" align=center><a href="javascript:window.print()">Print this page</a></td>

However, you should be able to just select the text in the WYSIWYG or Design view and act as if you are linking to another topic. In the Hyperlink dialog you w

...

Votes

Translate

Translate
Valorous Hero ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

Hi there

Interesting that you say you don't know anything about HTML or JavaScript, then post the HTML code and the JavaScript code!

I suppose if you want to do it the HTML way, the new code would look something like this:

<p style="font-size: 8pt; text-align: center;" align=center><a href="javascript:window.print()">Print this page</a></td>

However, you should be able to just select the text in the WYSIWYG or Design view and act as if you are linking to another topic. In the Hyperlink dialog you would type javascript:window.print();

Hopefully this was helpful... Rick

Helpful and Handy Links

RoboHelp Wish Form/Bug Reporting Form

Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!

Adobe Certified RoboHelp HTML Training

SorcerStone Blog

RoboHelp eBooks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

Very helpful, Rick, thank you!

I got the HTML code by going to the HTML view instead of the design view, and found the Javascript code on the Internet.

So, for another more complex one (also from the Internet), could I put it in a snippet and link to that in the hyperlink dialog?

Marion

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

Hi Marion.

Unfortunately snippets are not designed to work that way and you can't link to them. You may want to explore a macro solution. There are several around but I prefer Macro Express.


Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

Thanks, Colum, I'll look into that too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

You are wanting to create a simple link to a Snippet in a topic, correct? It can be done. See Item 4 in http://www.grainge.org/pages/authoring/rh7/using_rh7.htm


See www.grainge.org for RoboHelp and Authoring tips

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

Thanks, Peter. I'll give it a try.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2009 Oct 21, 2009

Copy link to clipboard

Copied

LATEST

I'm confused again.

We found some Javascript code that does what we need in another area - buttons to print the current page, and open a window of a specific size, with no scrollbars, etc.

However, when we tried to add that code, RH kept rewriting it, putting in quotes, etc., then rejecting it for having errors.

I found the insert script option, which doesn't rewrite the code, but now can't figure out (or find out online - I looked, really!) how to associate that script with a link the user can click on.  All I get is the little red box.

Can anyone help?  Please?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp