title: ie Context menu - opening URL using selected text
body: <p>I'm very unfamiliar with Java (mainly use VBA), and am trying to highlight text "CJ46216409", right click and open a new page using that string in the URL.</p>
  
  <p>(Intranet site)
  "<a href="http://maintrakau/OnForward/Wharf/Enquiry/Job_Enquiry.asp?jobno=CJ46216409" rel="nofollow noreferrer">http://maintrakau/OnForward/Wharf/Enquiry/Job_Enquiry.asp?jobno=CJ46216409</a>".</p>
  
  <p>I have added the new item to the context menu and am trying to work out the code needed.</p>
  
  <p>Have been researching building strings, but can't get the right combination for this to work (also don't know how to confirm if i'm setting the text variable correctly). Any assistance would be greatly appreciated.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var text  = document.selection.createRange().htmlText
  
  window.open('http://maintrakau/OnForward/Wharf/Enquiry/Job_Enquiry.asp?jobno=' + text ,'_blank');
  
  &lt;/script&gt;
  </code></pre>