0

Sorry if this is a simple or silly question but i have been trying to find the answer for a long time and i have had no luck in my search.

I am using TextPad 6 to learn JavaScript code(requested by tutor) but i have noticed a lot of the functions/methods etc i use are coming up with an error;

"Microsoft JScript runtime error: Object doesn't support this property or method"

Does anyone know how i can get TextPad to recognize any JavaScript code so i am not limited to the code i can use.

An example of the code it does not like is;

 if(selectedIndex.indexOf(index)>-1)

Thank you

  • I've never been aware of TextPad running JavaScript. Do you mean that you're going to `View > In Web Browser` and it's launching Internet Explorer maybe? – JMM Nov 26 '14 at 13:34
  • No there is a 'Tool Output' Option that lets you run JavaScript and shows the output when you press Ctrl+1. Its within TextPad but like a second window –  Nov 26 '14 at 13:45
  • 1
    It's not TextPad that's not recognizing your JS code -- it's whatever that JScript runtime is that's executing it. It sounds to me like that runtime might be equivalent to IE <= 8. – JMM Nov 26 '14 at 13:57

1 Answers1

0

I don't know exactly what your JS runtime is (sounds like it's equivalent to IE <= 8)* or how it's configured in TextPad, but I suggest that you'd be better off just running your code in a modern browser, like Chrome. That would also allow you to interactively debug it.

  • Array.prototype.indexOf() wasn't supported by IE until version 9.
JMM
  • 26,019
  • 3
  • 50
  • 55
  • 1
    You're welcome. If you're not familiar with the Chrome developer tools (especially the JavaScript debugger), I recommend you look into it. It is immensely helpful in working with JavaScript. – JMM Nov 26 '14 at 14:19