exceptions keine string?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • exceptions keine string?

    folgener code:
    PHP-Code:
    try
    {
      
    // irgendwas
    }
    catch (
    e)
    {
      
    alert (e
      
    feld exception.match (/("[a-z]{4,10}"\)/);

    das alert gibt dann so was wie "Type Error xml.getElementById("datum")[0].firstChild has no properties" aus. und ich wollte per match ("datum") herausfiltern. allerdings bekomme ich dann die fehlermeldung "e.match is not a function". match gehört ja zum String-Objekt, aber warum soll das hier keine funktion sein?
    selbst bei einem pisseligen
    PHP-Code:
    feld exception.match (/datum/); 
    erhalte ich die selbe meldung.

    btw: kümmert euch nicht um die fehlenden \, die wurden mal wieder vom forum verschluckt.

    gruß
    peter
    Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
    Meine Seite

  • #2
    Sowas hatte ich auch schon öfter. Machs halt einfach zum String - mit String()
    [FONT="Helvetica"]twitter.com/unset[/FONT]

    Shitstorm Podcast – Wöchentliches Auskotzen

    Kommentar


    • #3
      PHP-Code:
      feld e.message;
      feld feld.match (/("[a-z]{4,10}")/); 
      So funzt es nicht??? e dürfte ein Exception Objekt und kein String sein
      Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

      [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
      Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

      Kommentar


      • #4
        @unset
        hat geholfen.

        @jahlives
        das wollte ich wissen

        danke
        peter
        Zuletzt geändert von Kropff; 28.03.2008, 14:39.
        Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
        Meine Seite

        Kommentar


        • #5
          Re: exceptions keine string?

          PHP-Code:
          alerttypeof e );            // object
          alerttypeof e.message );    // string 
          Sagt eigentlich alles, oder?

          Kommentar


          • #6
            Guter Link zum Thema "Exceptions in JS"

            http://www.devshed.com/c/a/JavaScrip...tion-Handling/

            Gruss

            tobi
            Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

            [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
            Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

            Kommentar

            Lädt...
            X