[CLOSED] Javascript call to open a new window

  1. #1

    [CLOSED] Javascript call to open a new window

    In my code I am trying to open a new window when a button is clicked. This worked in 2.x but not in 4.x. Error is:
    Uncaught SyntaxError: Unexpected token )

    In can call this directly from javascript inside of a function but the ext call is doing something and I can't figure out what.

    serverside code:
     Ext.Net.X.Call("javascript:var popup = window.open('Settings.aspx'); popup.focus();")
    Last edited by fabricio.murta; Mar 13, 2017 at 7:57 PM.
  2. #2
    Hello @rmelancon!

    Interesting that this shouldn't work even in Ext.NET 2. You probably used Ext.Net.X.AddScript() on v2, no? X.Call() should only receive a javascript function name (followed by arguments, delimited by comma).

    Well, no matter what, please use AddScript() to run custom client-side code instead.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    You could be right, I may have copied the wrong function. Thanks!
  4. #4
    Glad it is clarified, thanks for the feedback!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. X.Js.call Open new window
    By rookie in forum 1.x Help
    Replies: 1
    Last Post: Jan 02, 2013, 5:46 AM
  2. Replies: 6
    Last Post: Feb 15, 2012, 4:15 PM
  3. [CLOSED] open window by javascript
    By pank in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 16, 2009, 3:36 AM
  4. [CLOSED] Open window from javascript
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 16, 2009, 3:28 AM
  5. Replies: 1
    Last Post: May 29, 2008, 8:29 AM

Posting Permissions