Results 1 to 3 of 3

Thread: Cut & Paste JSE internal seach engine v 1.0a

  1. #1
    Join Date
    Aug 2016
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Cut & Paste JSE internal seach engine v 1.0a

    http://www.javascriptkit.com/script/script2/jse/

    Above is link to free search engine in javascript. I m not a javascript expert and I really need help with this. Everything is working fine to me, only links on result.html page are on click opened in same window. I need them to open in specific frame, target. How I must change script to get this?
    Can someone help me, please?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    At the end of the jse_search.js file, we see:

    Code:
    function out_jse() {
    	if (co == 0) {
    		document.write('Your search did not match any documents.<p>Make sure all keywords are spelt correctly.<br>Try different or more general keywords.');
    		return;
    	}
    	for (var a = 0; a < r.length; a++) {
    		var os = r[a].split("^");
    		if (bold == 1 && m == 1) {
    			var br = "<b>" + d + "</b>";
    			os[2] = os[2].replace(pat, br);
    		}
    		if (include_num == 1) {
    			document.write(a + 1, '. <a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
    		} else {
    			document.write('<a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
    		}
    	}
    
    }
    Using a text only editor, insert your preferred target to both link constructions (highlighted in the above), save and use the new version (example assuming a new window/tab using target="_blank"):

    Code:
    function out_jse() {
    	if (co == 0) {
    		document.write('Your search did not match any documents.<p>Make sure all keywords are spelt correctly.<br>Try different or more general keywords.');
    		return;
    	}
    	for (var a = 0; a < r.length; a++) {
    		var os = r[a].split("^");
    		if (bold == 1 && m == 1) {
    			var br = "<b>" + d + "</b>";
    			os[2] = os[2].replace(pat, br);
    		}
    		if (include_num == 1) {
    			document.write(a + 1, '. <a target="_blank" href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
    		} else {
    			document.write('<a target="_blank" href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
    		}
    	}
    
    }
    Problems or questions? Let me know. The page will probably need to be refreshed to see changes. The browser cache might need to be cleared. If there are still issues, a link to your page where you are having them will help us help you.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Onsight (08-09-2016)

  4. #3
    Join Date
    Aug 2016
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much. Works!! You are awesome.
    Thanks again

Similar Threads

  1. Copy and paste...
    By Jack in forum The lounge
    Replies: 4
    Last Post: 03-05-2011, 09:59 PM
  2. looking for a seach box script
    By gadgetman in forum JavaScript
    Replies: 0
    Last Post: 01-21-2007, 02:08 PM
  3. Submitting to Seach Engines
    By DouginBC in forum The lounge
    Replies: 5
    Last Post: 10-24-2006, 09:49 PM
  4. Replies: 0
    Last Post: 01-11-2006, 08:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •