Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh Help with error when using string methods

    I have a code (actually a two-part one) that (tries to) take a link, save it in a session cookie, redirects to a page where the following code is located and then add part of one link with part of another.

    The problem I'm having is with some string methods (particularly slice/substring). Firefox says both of them are not functions:

    Code:
    <head>
    
    <script>
    
    <!--
    
    function viewhiddenstuff(){
    
    var cookielink=document.cookie
    
    var urlnum=cookielink.indexOf("marcasurl=")
    
    var seminum=cookielink.indexOf(";",urlnum)
    
    var urlstart=urlnum+10
    
    var geturl=cookielink.substring(urlstart,seminum)
    
    var friendnumber=geturl.indexOf('friendid')
    
    var fidstart=friendnumber+9
    
    var friendid=fidstart.substring(0,9)
    
    var commentslink="http://comment.myspace.com/index.cfm?fuseaction=user.viewComments&friendID=";
    
    var friendslink="http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID=";
    
    var which=window.confirm("Click OK to view hidden comments \n Click CANCEL to view hidden friends")
    
    if (which){
    window.location=commentslink+friendid}
    
    if (!which){
    window.location=friendslink+friendid}
    
    }
    
    //-->
    
    </script>
    </head>
    
    <body>
    <script>
    <!--
    viewhiddenstuff();
    //-->
    </script>
    
    <center><BR><BR><BR><BR><BR><BR><BR><font size=6 color=red font=arial>Loading applet</font></center>
    </body>
    If it's of any help it neither works on Safari nor on Firefox (OS X 10.4)

    The point is to take the friendid from a myspace URL, add it to the rest of another link to view comments on people's pages where they are hidden, and navigate to the makeshift link.

  • #2
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    nevermind

    I thought I had something in there that I didn't...thought I wasn't approaching the method correctly but the reason is I was trying to "slice" a number instead of a string.

    sorry for wasting your time.


  •  

    Posting Permissions

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