0

I am not great with java script. I have a number of web pages that are all almost identical. As a result I can use the same help page for all. All I want to do is pass the title of the current page to the help page.

The web pages might be called

Fiction eBooks, Non-Fiction eBooks, Classic Fiction eBooks... You get the picture. Every page looks pretty much the same, only the topic and eBook descriptions change.

Rather than create a help page for each type I want to create one help page and pass the type of eBook to it. For example:

The user is on a page titled, "Fiction eBooks" I want to call the help page like this, http://ebookwebsite.com/help.html?Type=Fiction

When the help page loads it will display "Fiction eBooks Help"

All I can find is information for passing form data from one web page to another. This is far more than I need.

4
  • 1
    can you post some code to clarify you problem? Commented Jun 14, 2016 at 14:13
  • 1
    You might want to add that code in code a formatted block to the question, so it get's more visible. Commented Jun 14, 2016 at 15:35
  • Try as I might I cannot get the HTML to format. This is in the eBook page <a href="/static/app/common/eBookHelp.html?query=Fiction" target="_blank">Fiction eBook Help</a></b> This is in the help page but it isn't correct. I don't know enough to know why. <td><center><b><font size="7"><script language="JavaScript"><%= request.getParameter("query") %></script> eBook Help Page</font></b></center></td> Commented Jun 14, 2016 at 15:48
  • Are you using ejs to template your html? Also please consider posting more code. Specifically, code that would give better context to how you generate your html via Splunker. Commented Jun 14, 2016 at 16:44

1 Answer 1

1

You can just send it as part of the url, if you are using a link.

eg: <a href="http://ebookwebsite.com/help.html?Type=Fiction">Help</a>

Depending on how you get the title for each, you can even make that link dynamically generated, i.e if you are using jstl or freemarker or handlebars or any such templating/pre rendering you could add the variable for type to prerender.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks. I had to obfuscate to some extent because this is for DoD. I'm really doing dashboards that are written in XML and then rendered by the Splunk engine. The actual title is embedded in the XML as an HTML module in the page. The link to help is pure HTML. I want to send exactly as you stated but I need the help page to capture and display it in the help page.
Could move the link into the XML, and get it rendered, which would be the best way, if not you will haveto figure out another way. I am unfamiliar with the Splunk engine.
Not possible. It must be rendered in HTML
Can't help you further with what I know, but I hope this is a start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.