ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

javascript question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • javascript question

    Hello All,

    I'm using the following code (see below) to retrieve querystring data as passed to the web page. I have no problems retrieving the value but the page opens up with a message "done, but with errors on page - line:8, char:9, error:expected ';', code:0"

    Javascript
    PRIVATE VOID PAGE_LOAD(OBJECT SENDER, SYSTEM.EVENTARGS E)
    {
    THIS.TXTBOX1.TEXT = REQUEST.QUERYSTRING["WEBDATA"];
    }


    Any ideas how to correct?

    Please advise.

    Thanks,

    Pagen

  • #2
    Re: javascript question

    This looks more like C# than JavaScript.
    Ben

    Comment


    • #3
      Re: javascript question

      It may be C#, not sure of the terminology...any ideas?

      Comment


      • #4
        Re: javascript question

        JavaScript is a scripting language commonly used for client side scripting on web pages and C# is a compiled object oriented language for the .net platform. They're two totally different things. It's helpful if we know what platform/language we're supposed to be looking at.

        I don't really know much about C# but if you are using this code in a JavaScript file then it probably isn't working because it's the wrong language?
        Ben

        Comment


        • #5
          Re: javascript question

          The code is embedded in a HTML source inside of <SCRIPT> </SCRUPT> tags. The usage was meant for retrieving querystring values as passed from an upfront RPG free program...

          Comment


          • #6
            Re: javascript question

            What do you mean by an "upfront RPG program"? It's sounds like you're trying to do things back to front.

            If you have script tags on an html page you should specify the language. You can get away without it but it's not valid HTML. It looks to me like you've googled for a solution but found something written in an inappropriate language for what you're attempting to do.

            The script tags should look similar to this:
            PHP Code:
            <script type="text/javascript">
            document.write("Hello World!")
            </
            script
            Here is an example of a JavaScript function for reading parms from a query string.


            However, you might be better off doing this another way. It's usually the server side program that reads a query string. It can then pass parameters to the client in the HTML that it generates.
            Ben

            Comment

            Working...
            X