Location hash

in
Subscribe to Location hash 6 posts, 3 voices



Avindra V.G. Scriptwright
FirefoxWindows

Just a suggestion: have the script detect if the post will be made on the same page, and if it is going to be on the same page, then just use the hash alone. (So that you can click on the quote, and just have it scroll up the page instead of reloading if it doesn't really have to).

e.g.:

<a href="#posts-145542">Quote</a>

vs.

<a href="http://userscripts.org/topics/30675#posts-145542">Quote</a>

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Avindra Gool... wrote:
just have it scroll up the page instead of reloading
Sounds like a good idea. I'll implement that.

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

I considered implementing this but then I realized: how would I know if when a reply is submitted it will go to the next page? I could could count the replies and if there were less than 25 then just use the hash. But what if you hadn't reloaded the page in awhile and somebody had already posted. This would push your post to the next page and make the quote link useless. I could always use ajax to check the number of replies when the "Quote" link is clicked, but if you take too long to write your reply somebody else could make the 25th post.

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
considered implementing this but then I realized: how would I know if when a reply is submitted it will go to the next page?
I'm super glad that you didn't implement this as I usually hand tailor the url to prevent or enable page reloads... and like you said one never knows if a link would go to the next page. :)

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

I don't know if I'm an odd ball or something but my browser never reloads the page when I click a wrote link that points to a quote on the same page.


On an unrelated note, I did a clean up of the code today, and also send a message to Jake Dahn asking if he could implement by quoting script into the site. I don't know how much work it would require to adapt my code but I'll let you know what he says.

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
my browser never reloads the page
Depends on cache control in the browser and also server side... also OSX might be caching HTTP requests too and if your Mac is super fast all around it wouldn't show the "flicker". My machine is pretty fast too but occasionally I'll see it re-render.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel