Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. problem with string.split() ?

problem with string.split() ?

Scheduled Pinned Locked Moved Web Development
helpjavascriptquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Klecker
    wrote on last edited by
    #1

    Hmmm... something is quite strange here. str = String(str).split(defaultDateSep) will actually return a javascript error (only in Netscape) stating that [object Object] is not a constructor. This code actually performs a few times correctly before it crashes. This one's leaving me puzzled. Anyone have any clue what might be happening with this? :confused: Thanks! Lawson Software - Desktop developer Chris Klecker

    T L 2 Replies Last reply
    0
    • C Chris Klecker

      Hmmm... something is quite strange here. str = String(str).split(defaultDateSep) will actually return a javascript error (only in Netscape) stating that [object Object] is not a constructor. This code actually performs a few times correctly before it crashes. This one's leaving me puzzled. Anyone have any clue what might be happening with this? :confused: Thanks! Lawson Software - Desktop developer Chris Klecker

      T Offline
      T Offline
      Troy Marchand
      wrote on last edited by
      #2

      Try splitting the code out into multiple lines. This way if/when it crashes you will have a better idea of what the problem is.

      1 Reply Last reply
      0
      • C Chris Klecker

        Hmmm... something is quite strange here. str = String(str).split(defaultDateSep) will actually return a javascript error (only in Netscape) stating that [object Object] is not a constructor. This code actually performs a few times correctly before it crashes. This one's leaving me puzzled. Anyone have any clue what might be happening with this? :confused: Thanks! Lawson Software - Desktop developer Chris Klecker

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Which version of netscape are you having problems in? I tried your code in NN 4.7 and 6.1 and it worked fine. If you are doing it in NN 3, it does not support the split method. Here is a more robust way of coding this though. var sTemp = new String(str); var sStrings = sTemp.split(defaultDateSep); Hope this helps. Bill Kim frogwerk Inc.

        C 1 Reply Last reply
        0
        • L Lost User

          Which version of netscape are you having problems in? I tried your code in NN 4.7 and 6.1 and it worked fine. If you are doing it in NN 3, it does not support the split method. Here is a more robust way of coding this though. var sTemp = new String(str); var sStrings = sTemp.split(defaultDateSep); Hope this helps. Bill Kim frogwerk Inc.

          C Offline
          C Offline
          Chris Klecker
          wrote on last edited by
          #4

          thanks for the help. It turns out it was linked to someone using the following line earlier in the program var Array = arrayTemp; oh well... the frustration of having to maintain someone elses code. ;-) "Why are we hiding from the police, Daddy?" "We use VI, son. They use Emacs."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups