Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 7 of 7

Thread: calling javascript from display option

  1. #1
    Member
    Join Date
    Jun 2007
    Location
    Bordeaux, France
    Posts
    53

    Unhappy calling javascript from display option

    Hi,

    To overcome the issue with us.launch.external that does not work in SC 6.1.4 with the language pack... I have had then idea to create a very simple javascript and call it from the display option.

    However after many attempts i am running out of idea as to how to call a javascript from the disply option.

    Can anyone help please?

    Cheers

    Fred

  2. #2
    Senior Member glg's Avatar
    Join Date
    Aug 2004
    Location
    Chicago, IL, USA
    Posts
    715

    Default

    jscall(library.function, param1, param2, ...) will work from anywhere you can run RAD expressions.

  3. #3
    Member
    Join Date
    Jun 2007
    Location
    Bordeaux, France
    Posts
    53

    Default

    Glg,

    Thanks a lot for your reply. I have tried that today in the RAD tab within the Display Option. No luck unfortunately.... Unless I am doing something wrong which is always a very likely possibility... ;-).

    This is the error message that I get when I test the line I have entered in the RAD tab:

    Format "jscall(testurl.poptastic,"http://www.google.com")" not found (display,call.thread.go)

    I am not actually that fussed with the javascript solution. If anyone has a workaround to ensure that us.launch.external works, I'll take it!

    Many thanks in advance for your help

    Fred

  4. #4
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    Try this

    Code:
    $void=jscall("testurl.poptastic","http://www.google.com")
    Or in the javascript box

    Code:
    system.library.testurl.poptastic("http://www.google.com")
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  5. #5
    Member
    Join Date
    Jun 2007
    Location
    Bordeaux, France
    Posts
    53

    Default

    Hi Tommy,

    Thanks for that. I have used your first option and it seems to be ok. However, ServiceCenter does not seem to like the very common javascript window.open function.

    The error message I get now is:

    Script 'testurl' ligne 1 : ERROR ReferenceError: window is not defined au car 1

    The problem is the I cannot find on the web teh details of that function.

    In case I am missing something... here is the script I have added to the library:

    function openInNewWindow() {
    var newWindow = window.open("google.com");
    newWindow.focus();
    return false;
    }

    Any idea?

    Cheers

    Fred

  6. #6
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    The JavaScript implementation in SC6 is only serverside scripting and window.open is client side.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  7. #7
    Member
    Join Date
    Jun 2007
    Location
    Bordeaux, France
    Posts
    53

    Default

    Hi Tommy,

    That would explain why then....Shame that the us.launch.external RAD function does not work with the language pack. It would help somehow... :-(

    Thanks for a great forum btw.

    Cheers

    Fred

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts