Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
##filename=perlmonks.html## <html> <head> <title>Perlmonks Navigator</title> </head> <frameset cols='10%,90%'> <frame name='control' src='nav.html' scrolling='yes'> <frame name='perlmonks' src='http://www.perlmonks.org/index.pl?node_id=26179' scrolling= +'yes'> </frameset> </html> ##filename=nav.html## <html> <head> <title>Perlmonks Navigation Sidebar</title> </head> <body> <form name="nav_control"> <input type="button" value="prev" onClick="move(-1)"><br> <input type="button" value="next" onClick="move(1)"><p> <input type="text" size="8" name="article_no"><br> <input type="button" value="jump" onClick="move_to(document.nav_c +ontrol.article_no.value)"><p> <input type="button" value="cookie" onClick="alert(document.cooki +e)"> </form> <script> var cookie_index = "pm_index"; function get_next_year () { var year = new Date(); year.setFullYear(year.getFullYear() + 1); return year; } // Takes the encoded name of the attrib, returns the decoded valu +e function get_cookie_attrib (name) { var stored_as = unescape(name) + "="; var pieces = document.cookie.split(/; /); for (my_index in document.cookie.split("")) { var piece = pieces[my_index]; if (null == piece) continue; if (0 == piece.indexOf(stored_as)) { var escaped_val = piece.substr(stored_as.length); return unescape(escaped_val); } } return null; } // Gets the current pos or "tilly"'s home node function get_cur_pos () { // Don't forget that this should be a number. var cur_pos = get_cookie_attrib(cookie_index) - 0; return (0 == cur_pos ? 26179 : cur_pos); } // Move forward or back function move (count) { move_to(get_cur_pos() + count); } // Takes an index, moves there. function move_to (pos) { set_cookie_attrib(cookie_index, pos); document.nav_control.article_no.value = pos; parent.perlmonks.location.href = "http://www.perlmonks.org/index.pl?node_id=" + pos; } // Takes a name/value, encodes and stores them in the cookie function set_cookie_attrib (name, value) { // This does not disturb other attributes. Why? // Just another stupid JavaScript interface decision. :-( var cookie_str = escape(name) + "=" + escape(value); cookie_str += ";expires= " + get_next_year().toGMTString(); document.cookie = cookie_str; } // Default location move_to(get_cur_pos()); </script> </body> </html>

In reply to Perlmonks Navigator by tilly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found