Navigate to URL with parameter passed to script at startup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rpelletier
    New Member
    • Jan 2010
    • 3

    Navigate to URL with parameter passed to script at startup

    Good morning....As you will see when you view the script I am fairly new to Java. All I am trying to accomplish with this script is to navigate to the static URL listed in the script, however, one of the parameters in the URL requires the "Contact_Ph one" variable which I pass to the script at runtime as a telephone number similar to the following;

    "Siebel_Query_W ith_ANI.html 813466XXXX"

    All the logic works great if I enter the phone number as a static entry in the URL or if I just assign this value to a variable within the script and reference that variable within the URL. I really need to launch the script with this varriable as the number changes each time.

    Thank you in advance....PLEA SE HELP.....

    Code:
    <html>
    <head>
    <script>
    Contact_Phone = WScript.Arguments.Item(0)
    <script/>
    
    <script type="text/javascript">
      
    window.navigate("http://sdcrmweb01:80/ecommunications_enu/start.swe?SWECmd=InvokeMethod&SWEMethod=GetContact&SWEService=SND_CTI_Call&ViewName=All&Contacts&across&Organizations&BusObject=Contact&BusComp=Contact&Phone=" + Contact_Phone + "&SWERF=1&SWEBU=1","siebelcti");
    </script>
    
    </head>
    </html>
    Last edited by Dormilich; Jan 19 '10, 08:14 PM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    where do you get that phone number from?

    PS. this is not Java it’s JavaScript, there are some fundamental differences

    Comment

    • rpelletier
      New Member
      • Jan 2010
      • 3

      #3
      Thank you Dormilich for your response. The phone number gets automatically generated and stored in a variable when our call center receives a support call. I have an interface that automatically will launch an external program and also allowes me to call the external program and include this variable. This part works consistantly and I have viewed the variable and have never seen it not resolve to the caller-id/phone number. As I also mentioned if I manually store the phone number to a variable inside the script it navigates to the url and performs the query perfectly. I am struggling with this and as per your comment you can tell that I am not a seasoned developer.

      Any guidance you could provide would certainly be appreciated.
      Thank you...

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        as far as I have understood.

        a) the phone number is correctly passed to the script
        b) the URL works
        c) the page (resp. the script) does not work

        if that’s right, I can present a solution:
        there is no window.navigate () method (ref. window). to load a new page use window.location .href = "http://www.example.org/page.html";

        Comment

        • rpelletier
          New Member
          • Jan 2010
          • 3

          #5
          Thank you for your response......I can run the script in it's current configuration, and when I substitute the variable "Contact_Ph one" with a valid phone number "8134660923 the URL will launch IE and navigate to the correct page every time. The only issue I am hoping to resolve is the external phone number variable is not being passed to the script. I have verrified that the phone number is valid.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            If you add an alert after Contact_Phone is set, what do you get?

            Is
            Code:
            WScript.Arguments.Item(0)
            JScript (for IE) on the client-side or is it meant to be, say, ASP server-side code?

            Comment

            Working...