Problem Processing JavaScript DHTML Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WPPJames
    New Member
    • May 2010
    • 8

    Problem Processing JavaScript DHTML Function

    I have a desktop software product (Rmsad.exe) that runs as a process in the background. Periodically, Rmsad.exe makes a call to a .php page (smfeed.php) on my server. One of the parameters it sends over is an URL to load in a DHTML window. Inside smfeed.php, I call a javascript function that displays the DHTML window:

    Code:
    var googlewin=dhtmlwindow.open("googlebox", "iframe", '<?php echo $outurl2; ?>', "Title text here",
    "width=<?php echo $winwd; ?>px,height=<?php echo $winht; ?>px,resize=1,scrolling=1,center=1", "recal")
    This is a replacement for calling a basic javascript pop-up window. The script is a slightly expanded version of the one here:



    Here's the layout of the smfeed.php page:

    Code:
    <?php
    //Php code that exist here gets properly executed
    //
    //
    ?>
    
    <script type="text/javascript" src="deluxe-popup-window.js"></script>
    <script type="text/javascript">
    var googlewin=dhtmlwindow.open("googlebox", "iframe", '<?php echo $outurl2; ?>', "Title text here", "width=<?php echo $winwd; ?>px,height=<?php echo $winht; ?>px,resize=1,scrolling=1,center=1", "recal")
    </script>
    
    <?php
    //Php code that exist here gets properly executed
    //
    //
    ?>
    If you call the smfeed.php page directly, by manually entering it's URL into a browser address bar, the DHTML window script (dhtmlwindow.op en) works fine. The DHTML window gets displayed. However, when smfeed.php is called from msad.exe, the window doesn't load at all. I tried replacing the dhtmlwindow.ope n statement with a very basic:

    Code:
    <script type="text/javascript">
    window.open ('http://www.bing.com')
    </script>
    statement, just to test with a less complex javascript. It wouldn't load a window either. Again, both work if calling smfeed.php directly. There is php code before and after the javascript DHTML call. All the php code gets executed properly. So I know the entire smfeed.php page is getting processed.

    Any ideas why the javascript functions won't work when contacted by Rmsad.exe?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    It looks like your program doesn’t host a JavaScript environment (like e.g. V8, Nitro, SpiderMonkey, Rhino).

    Comment

    • WPPJames
      New Member
      • May 2010
      • 8

      #3
      Thanks Dormilich. I had the Rmsad.exe app developed for me in C#. Any suggestions you can offer to make this work (or alternative strategy) that I can pass on to my developer?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        you (resp. your developer) would have to implement a JavaScript engine. you would end up with half a browser then.

        Comment

        Working...