Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Search within html <body> tags

  1. #11
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    596
    Thanks
    43
    Thanked 28 Times in 28 Posts

    Default

    The input you are talking about in your first post,is it unique(different) on each page?

    How is this number used on the pages?

    Is it a title,div name,a code,or something else specific to each page?

    You seem to be looking for a way to get a page by this input.What are your pages?-are you selling stuff?

    I think we need more info as to what exactly you are trying to do.
    Thanks,

    Bud

  2. #12
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes every page contains different title div and codes .. like in my first posts i have shown my template code
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>my title</title>
        <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
        <script type="text/javascript" src="jquery.js"></script>
    </head>
    <body>
    here is the code like 234556 with some other contents
        
    </body>
    </html>
    I want when link is clicked the one page template should get title as well as body tags changes

    i know that i can make it by creating different HTML pages but it will make load to the server by placing numerous HTML pages .. I am looking for a script where one template page should do this job

  3. #13
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,381
    Thanks
    31
    Thanked 148 Times in 142 Posts
    Blog Entries
    34

    Default

    So you don't want different pages? I was confused by your previous post, where you had several pages.
    Experiment with something like this:
    Code:
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: #dedede}
    </style>
    
    <script>
    function first_link()
    {
    location.href='?<br><br>Code: <a href="javascript: void(0)" onclick="second_link()">bla bla</a>'
    }
    function second_link()
    {
    alert('hello')
    }
    </script>
    
    </head>
    
    <body>
    
    <div id="add">
    <a href="?Search result:<br><br>Click <a href='javascript: void(0)' onclick='first_link()'>here</a>" >234556</a>
    </div>
    
    
    <script>
    if(location.search)
    {
    document.getElementById('add').innerHTML=unescape(location.search.substring(1))
    }
    </script>
        
    </body>
    </html>

  4. #14
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Sir molendijk , I know you are the right master I got a chance to learn from ...

    I actually want the same thing done with the pages shown in my post #8 .. I will be highly thankful If you will code atleast for two links on each page

    Thanks in advance

  5. #15
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,381
    Thanks
    31
    Thanked 148 Times in 142 Posts
    Blog Entries
    34

    Default

    Janu, I'm very busy right now, but I'll make something for you as soon as I'll have the time (probably somewhere within the next 12 hours)

  6. #16
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,381
    Thanks
    31
    Thanked 148 Times in 142 Posts
    Blog Entries
    34

    Default

    Okay, here's something more elaborate. Try to understand the code. Don't hesitate to ask (further) questions.
    Code:
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: #dedede; }
    </style>
    
    <!-- *******************WHATSUP AND VERSIONS******************* -->
    <script>
    var link_whatsup=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>WHATSUP VERSIONS AND CODES</span>:<br>"+
    "<ul>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_1_1'>Version 1.1 Code: 2435</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_1_2'>Version 1.2 Code: 5687</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_2_11'>Version 2.11 Code: 0986</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_2_2'>Version 2.2 Code: 7098</a>"+
    "</ul>"
    
    var link_version_1_1=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD WHATSUP <br>VERSION 1.1 CODE: 2435</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_1_1()'>DOWNLOAD</a>"
    
    var link_version_1_2=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD WHATSUP <br>VERSION 1.2 CODE: 5687</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_1_2()'>DOWNLOAD</a>"
    
    var link_version_2_11=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD WHATSUP <br>VERSION 2.11 CODE: 0986</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_2_11()'>DOWNLOAD</a>"
    
    
    var link_version_2_2=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD WHATSUP <br>VERSION 2.2 CODE: 7098</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_2_2()'>DOWNLOAD</a>"
    
    </script>
    
    
    <script>
    function link_download_version_1_1()
    {
    alert('hello to version 1.1')
    }
    
    function link_download_version_1_2()
    {
    alert('hello to version 1.2')
    }
    
    function link_download_version_2_11()
    {
    alert('hello to version 2.11')
    }
    
    function link_download_version_2_2()
    {
    alert('hello to version 2.2')
    }
    
    
    </script>
    
    <!-- *******************END WHATSUP AND VERSIONS******************* -->
    
    
    <!-- *******************OPERA******************* -->
    <script>
    var link_opera=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>OPERA VERSIONS</span>:<br>"+
    "<ul>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_opera_15_0'>Opera Version 15.0</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_opera_12_15'>Opera Version 12.15</a><br><br>"+
    "</ul>"
    
    var link_opera_15_0=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD OPERA <br>VERSION 15.0</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_opera_15_0()'>DOWNLOAD</a>"
    
    var link_opera_12_15=
    "?"+
    "<span style='font-size: 150%; font-weight: bold'>DOWNLOAD OPERA <br>VERSION 12.15</span>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_opera_12_15()'>DOWNLOAD</a>"
    
    
    </script>
    
    <script>
    function link_download_opera_15_0()
    {
    alert('hello to Opera version 15.0')
    }
    
    function link_download_opera_12_15()
    {
    alert('hello to Opera version 12.15')
    }
    </script>
    <!-- *******************END OPERA******************* -->
    
    
    
    </head>
    
    <body>
    <div style="position: absolute;left: 50px; top: 50px; right: 50px; bottom: 50px; border: 1px solid black; padding: 20px; background: white">
    <div style="position: relative; text-align: center;"><button style="cursor: pointer" onclick="location.href='applications.html'">HOME</button> <button>SEARCH BY VERSION</button> <button>ABOUT</button></div>
    
    <br><br><div id="add" style="position: relative; top:50%; margin-top:-130px; ">
    <span style="font-size: 150%; font-weight: bold">LIST OF APPLICATIONS</span><br>
    <ul >
    <li><a href="javascript: void(0)" onclick="location.href=link_whatsup; return false">Whatsup</a><br><br>
    <li><a href="javascript: void(0)" onclick="location.href=link_opera; return false">Opera</a><br><br>
    <li>Skype<br><br>
    <li>Mozilla
    </ul>
    </div>
    
    </div>
    
    <script>
    if(location.search)
    {
    document.getElementById('add').innerHTML=unescape(location.search.substring(1))
    }
    </script>
        
    </body>
    </html>

  7. #17
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks every step of urs are providing me a chance to learn

    but the urls are not what i intended to achieve

    applications.html?%3Cspan%20style=%27font-size:%20150%;%20font-weight:%20bold%27%3EWHATSUP%20VERSIONS%20AND%20CODES%3C/span%3E:%3Cbr%3E%3Cul%3E%3Cli%3E%3Ca%20href=%27javascript:%20void(0)%27%20onclick=%27location.href=link_version_1_1%27%3EVersion%201.1%20Code:%202435%3C/a%3E%3Cbr%3E%3Cbr%3E%3Cli%3E%3Ca%20href=%27javascript:%20void(0)%27%20onclick=%27location.href=link_version_1_2%27%3EVersion%201.2%20Code:%205687%3C/a%3E%3Cbr%3E%3Cbr%3E%3Cli%3E%3Ca%20href=%27javascript:%20void(0)%27%20onclick=%27location.href=link_version_2_11%27%3EVersion%202.11%20Code:%200986%3C/a%3E%3Cbr%3E%3Cbr%3E%3Cli%3E%3Ca%20href=%27javascript:%20void(0)%27%20onclick=%27location.href=link_version_2_2%27%3EVersion%202.2%20Code:%207098%3C/a%3E%3C/ul%3E

    as I requested that url of each page should be like this


    Ist page



    2nd page



    3rd page



    I am sorry to trouble you every time

  8. #18
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,381
    Thanks
    31
    Thanked 148 Times in 142 Posts
    Blog Entries
    34

    Default

    That's a consequence of two of your requirements:
    1. The URL must not be static ('the same all the time');
    2. No external files for modifying the body content.

    But there may be a workaround for the weird URLS in the address bar. I'll give it a try soon.

  9. #19
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks bit changes

    Ist page when clicked on whatsup
    url=mydomain.com/app/whatsup.html?versions
    2nd page when clicked on version 1.1 Code:2435
    url= mydomain.com/app/whatsup.html?versions=1.1&code=2435

    for the same way for Opera on first page
    url=mydomain.com/app/opera.html?versions
    2nd page when clicked onversion 1.1 Code:2435
    url= mydomain.com/app/opera.html?versions=1.1&code=2435


    ist page



    2nd page



    3rd page
    Last edited by janu; 07-04-2013 at 02:02 PM.

  10. #20
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,381
    Thanks
    31
    Thanked 148 Times in 142 Posts
    Blog Entries
    34

    Default

    Janu, this is as close as I can get (explanations below):
    Code:
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: #dedede; }
    </style>
    
    <script>
    var space="                                                                                                                                                                                                                                                                                                                                                                                                                   "
    </script>
    
    
    <!-- *******************WHATSUP AND VERSIONS******************* -->
    <script>
    var link_whatsup=
    "?"+escape("mydomain.com/app/whatsup.html-->versions"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>WHATSUP VERSIONS AND CODES:</div><br>"+
    "<ul style='position: relative; top: -25px'>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_1_1'>Version 1.1 Code: 2435</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_1_2'>Version 1.2 Code: 5687</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_2_11'>Version 2.11 Code: 0986</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_version_2_2'>Version 2.2 Code: 7098</a>"+
    "</ul>")
    
    
    
    
    var link_version_1_1=
    "?"+escape("mydomain.com/app/whatsup.html-->versions-->version 1.1 code 2435"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD WHATSUP <br>VERSION 1.1 CODE: 2435</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_1_1()'>DOWNLOAD</a>")
    
    var link_version_1_2=
    "?" + escape("mydomain.com/app/whatsup.html-->versions-->version 1.2 code 5687"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD WHATSUP <br>VERSION 1.2 CODE: 5687</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_1_2()'>DOWNLOAD</a>")
    
    var link_version_2_11=
    "?"+ escape("mydomain.com/app/whatsup.html-->versions-->version 2.11 code 0986"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD WHATSUP <br>VERSION 2.11 CODE: 0986</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_2_11()'>DOWNLOAD</a>")
    
    
    var link_version_2_2=
    "?"+ escape("mydomain.com/app/whatsup.html-->versions-->version 2.2 code 7098"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD WHATSUP <br>VERSION 2.2 CODE: 7098</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_version_2_2()'>DOWNLOAD</a>")
    
    </script>
    
    
    <script>
    function link_download_version_1_1()
    {
    alert('hello to version 1.1')
    }
    
    function link_download_version_1_2()
    {
    alert('hello to version 1.2')
    }
    
    function link_download_version_2_11()
    {
    alert('hello to version 2.11')
    }
    
    function link_download_version_2_2()
    {
    alert('hello to version 2.2')
    }
    
    
    </script>
    
    <!-- *******************END WHATSUP AND VERSIONS******************* -->
    
    
    <!-- *******************OPERA******************* -->
    <script>
    var link_opera=
    "?"+escape("mydomain.com/app/opera.html-->versions"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>OPERA VERSIONS:</div><br>"+
    "<ul>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_opera_15_0'>Opera Version 15.0</a><br><br>"+
    "<li><a href='javascript: void(0)' onclick='location.href=link_opera_12_15'>Opera Version 12.15</a><br><br>"+
    "</ul>")
    
     
    
    var link_opera_15_0=
    "?"+escape("mydomain.com/app/opera.html-->versions-->version 15.0"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD OPERA <br>VERSION 15.0</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_opera_15_0()'>DOWNLOAD</a>")
    
    var link_opera_12_15=
    "?"+escape("mydomain.com/app/opera.html-->versions-->version 12.15"+space +"<br>"+
    "<div style='position: relative; font-size: 150%; font-weight: bold; top:-15px; z-index:1; background: white; width: 100%'>DOWNLOAD OPERA <br>VERSION 12.15</div>" +
    "<br><br><a href='javascript: void(0)' onclick='link_download_opera_12_15()'>DOWNLOAD</a>")
    
    
    </script>
    
    <script>
    function link_download_opera_15_0()
    {
    alert('hello to Opera version 15.0')
    }
    
    function link_download_opera_12_15()
    {
    alert('hello to Opera version 12.15')
    }
    </script>
    <!-- *******************END OPERA******************* -->
    
    
    
    </head>
    
    <body>
    <a href="javascript: void(0)" onclick="location.href='index.html'; return false">Index (home)</a><br><br>
    <a href="javascript: void(0)" onclick="location.href=link_whatsup; return false">Whatsup versions and codes</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_version_1_1'>Version 1.1 Code: 2435</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_version_1_2'>Version 1.2 Code: 5687</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_version_2_11'>Version 2.11 Code: 0986</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_version_2_2'>Version 2.2 Code: 7098</a><br><br>
    
    <a href="javascript: void(0)" onclick="location.href=link_opera; return false">Opera versions</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_opera_15_0'>Version 15.0</a><br>
    <a href='javascript: void(0)' onclick='location.href=link_opera_12_15'>Version 12.15</a>
    
    
    
    <div style="position: absolute;left: 200px; top: 50px; right: 200px; bottom: 50px; border: 1px solid black; padding: 20px; background: white">
    <div style="position: relative; text-align: center;"><button style="cursor: pointer" onclick="location.href='index.html'">HOME</button> <button>SEARCH BY VERSION</button> <button>ABOUT</button></div>
    
    <br><br><div id="add" style="position: relative; top:50%; margin-top:-130px; ">
    <span style="font-size: 150%; font-weight: bold">LIST OF APPLICATIONS</span><br>
    <ul >
    <li><a href="javascript: void(0)" onclick="location.href=link_whatsup; return false">Whatsup</a><br><br>
    <li><a href="javascript: void(0)" onclick="location.href=link_opera; return false">Opera</a><br><br>
    <li>Skype<br><br>
    <li>Mozilla
    </ul>
    </div>
    
    </div>
    
    <script>
    if(location.search)
    {
    document.getElementById('add').innerHTML=unescape(location.search.substring(1))
    }
    </script>
        
    </body>
    </html>
    The URLS are friendly and informative now.
    All 'pages' can be bookmarked (although there's only one real page, called index.html).
    The URLS in the address bar are slightly different from what you asked, because - although we can manipulate the text in the address bar - not all symbols can be used for that.
    If a visitor watching one of your pages, say: mydomain.com/app/whatsup.html-->versions-->version 1.2 code 5687, wants to copy the address from the address bar, he/she doesn't in fact copy mydomain.com/app/whatsup.html-->versions-->version 1.2 code 5687 to the clipboard, but:
    Code:
    index.html?mydomain.com/app/whatsup.html--%3Eversions--%3Eversion%201.2%20code%205687%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cbr%3E%3Cdiv%20style%3D%27position%3A%20relative%3B%20font-size%3A%20150%25%3B%20font-weight%3A%20bold%3B%20top%3A-15px%3B%20z-index%3A1%3B%20background%3A%20white%3B%20width%3A%20100%25%27%3EDOWNLOAD%20WHATSUP%20%3Cbr%3EVERSION%201.2%20CODE%3A%205687%3C/div%3E%3Cbr%3E%3Cbr%3E%3Ca%20href%3D%27javascript%3A%20void%280%29%27%20onclick%3D%27link_download_version_1_2%28%29%27%3EDOWNLOAD%3C/a%3E
    .
    If the person opens a new window and puts that longs string in the address bar, he / she will get the right 'page'. This long URL will change into a 'fiendly' one as soon as he / she starts navigating the page, so there's no real problem.
    I've put all the links at the left of the page to help you understand how they should be created.
    Once you understand the method, you can develop this further.

Similar Threads

  1. How do I add search Related Tags to my site?
    By vjboc in forum Looking for such a script or service
    Replies: 0
    Last Post: 11-14-2011, 08:53 PM
  2. Replies: 2
    Last Post: 11-24-2009, 07:53 PM
  3. Replies: 11
    Last Post: 06-15-2008, 04:13 PM
  4. 2 onload tags in the body tag
    By Frazmand in forum JavaScript
    Replies: 3
    Last Post: 07-26-2006, 08:04 PM
  5. HTML: Body Onloads!
    By wmcobra3670 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 01-07-2006, 07:03 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
  •