inherit
194230
0
Nov 21, 2015 5:56:42 GMT -8
Alan Vende
4,215
May 2013
l1o2u3i4s5
|
Post by Alan Vende on Aug 25, 2015 8:36:17 GMT -8
Forum URL: psychic-psyghtings.proboards.comI have the Recent Threads and Recent Posts buttons next to my Participated button on my forum. The code for that is as follows: <script>
$(function(){
var recent = $("a.recent-threads-button");
recent.clone().attr("href", "/posts/recent").html("Recent Posts").insertBefore($("#navigation-tree"));
recent.clone().attr("href", "/threads/recent").html("Recent Threads").insertBefore($("#navigation-tree"));
});
</script> I assume that that would be correct, right? Also, I noticed that there isn't <script type="text/javascript"> in this instance. Or in some other instances in my header/footer and whatnot. Should it have that? Or no? Thanks so much!
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 25, 2015 11:56:51 GMT -8
Hi, Alan Vende. It should look like this. I've changed it so that it accounts for whether or not you're logged in (guests don't have a user ID or a Participated button). Having the type attribute in a script tag isn't entirely necessary for Javascript but it's good practice for ensuring backwards compatibility with browsers.
|
|
inherit
194230
0
Nov 21, 2015 5:56:42 GMT -8
Alan Vende
4,215
May 2013
l1o2u3i4s5
|
Post by Alan Vende on Aug 25, 2015 12:01:05 GMT -8
Thanks so so much, Brian! I thought it was all a bit the same, but I guess not. My bad. Thanks for the correction(s)! And thanks for the information about the tags!
|
|
inherit
194230
0
Nov 21, 2015 5:56:42 GMT -8
Alan Vende
4,215
May 2013
l1o2u3i4s5
|
Post by Alan Vende on Aug 25, 2015 12:06:33 GMT -8
Brian, this is weird. I just put it into my test forum and now the only thing is there is the Participated button as it was before I put the Recent Threads/Posts buttons for the forum itself. All I did was highlighted the old code and copy/pasted the new one on top of it. ...At least, that's what I thought I did I looked at the rest of my code and nothing looks out of place. Did I implement something wrong? I'm asking because, like I said, I can't see anything.
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 25, 2015 12:09:34 GMT -8
You were missing the closing quotation mark after My Recent Threads. Should be fixed now.
|
|
inherit
194230
0
Nov 21, 2015 5:56:42 GMT -8
Alan Vende
4,215
May 2013
l1o2u3i4s5
|
Post by Alan Vende on Aug 25, 2015 12:12:06 GMT -8
Oi. I didn't notice that. Thanks for the fix, Brian!
|
|