function - Javascript setting variables and object and proper syntax (debug console) -


So I am trying to invoke the methods on one page and I know that I know the ways which I want to put things in. But I do not seem to work syntax. I think it is okay .. Amplified

OK, here is the JavaScript method on the page

  function return value (sValue, steext) {window.focus (); Var oForm = document.EditForm; Switch (szType) // Form element name {case 'agt': oForm.agt.value = sText; OForm.agentman.value = sValue; OForm.agtid.value = sValue; OForm.getagt.focus (); break; Case 'County': oForm.County.value = sValue; SCurrentCounty = new string (sValue); Document.all ("County Dizp"). InnerHTML = sText; Document.all ("City"). Value = ""; Document.all ("City Disp"). InnerHTML = ""; Document.all ("Area"). Value = ""; Document.all ("AreaDisp"). InnerHTML = ""; break; Default: Break; } // and switch returns; }  

Very straight forward function and you assume that the parameters were string, right? So I tried to do this in the IE8 script Debugger console:

Return value ("ADF", "asdf");

Object is expected, well, maybe I need single quotes for strings which I assumed in the next (just in case).

ReturnValue ('adf', 'asdf'); // Fail "Object Expected"

Ok, just making sure .. So I need an object that stores the string. How I was thinking about using a var ..

var o = "adf"; Var p = "dfsa"; ReturnValue (O, P); // failed "object expected"

I have tried with only one quotation marks. So after all I believe that an object is needed. So I tried to make an object.

o = new object (); K = new object (); // {.....}

Now I do not know how to add strings in an object, so I did this.

O.value = "text"; K.value = "field"; // "text" ... "field"

okay now I am feeling excited now that I have an object with some string, so now I will put it together again I try to keep from / P>

Return Value (O, Z) // EPIC "Object Expected"

I'm putting objects there!

After further investigation, I came to know that the script actually starts once page loads I can debug and break and when the code is paused, I can run the methods Am But after my release and after declaring all the variables, I can not run any way. But, for some reason I can run with a popup using the same method I'm trying to run. Oppenor Return value (string, string);

I do not get this!

szType, defined somewhere else, I pasted this function in a scratch page And played with it and I can not reproduce this problem in IE8 (or Firefox 3)

Swing around, the only thing I found was a reference saying that if you have incorrectly set the type of script you can get it because the IE script parsed on the block at all Will not Is your script block set as "text / javascript"?

If that does not work, can you provide as many codes as possible (maybe even markup)?

Note, you may want to look at other JS libraries or use any other. This way browser-specific JS is bad (death to document. All).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -