Uh, prototype is a frontend library, it doesn't actually expose things. I
think any of the doName (like doAjax) expose as web GETters

var request = new XMLHttpRequest();
request.open('GET', "${it.baseUrl}/buildHistory/all", true);

request.onload = function() {
  if (this.status >= 200 && this.status < 400) {
    // Success!
    var hist = $$("buildHistory");

    var newhist = document.createElement('div');
    newhist.innerHTML = this.response.text;
    newhist.headers = hist.headers

    relace(hist, newhist);
    fireBuildHistoryChanged();
  } else {
    // We reached our target server, but it returned an error
  }
};

request.onerror = function() {
  // There was a connection error of some sort
};

request.send();

```


```
              new Ajax.Request("${it.baseUrl}/buildHistory/all",{
                method: "get",
                onComplete: function(rsp,_) {
                  <!-- neither outerHTML nor responseXML works in Firefox
2.0 -->
                  var hist = $$("buildHistory");

                  var newhist = document.createElement('div');
                  newhist.innerHTML = rsp.responseText;
                  newhist.headers = hist.headers

                  replace(hist, newhist);
                  fireBuildHistoryChanged();
                }
            });
            }
```
becomes
```


On Tue, May 19, 2020 at 12:27 PM Ullrich Hafner <ullrich.haf...@gmail.com>
wrote:

> The problem with the alternatives is that they have no server counterpart.
> Or how do you route the requests to the Java model when using jQuery
> directly?
>
> Am 19.05.2020 um 20:52 schrieb 'Gavin Mogan' via Jenkins Developers <
> jenkinsci-dev@googlegroups.com>:
>
> Ajax.Request is actually prototype, and I strongly recommend not using it,
> as its incredibly old and has messed with a lot of standard apis.
>
> I recommend using jquery, or the native alternatives (XMLHttpRequest/fetch)
>
> http://youmightnotneedjquery.com/ (search for ajax) has some good examples
>
> On Tue, May 19, 2020 at 11:49 AM Ullrich Hafner <ullrich.haf...@gmail.com>
> wrote:
>
>> You can also have a look at some plugins that use the new JS UI
>> components (bootstrap, charts, datatables). All of these plugins use Ajax
>> to populate charts and tables: they also use the techniques described in
>> the wiki and I can confirm that it works! What exactly is not working in
>> your plugin?
>>
>> The plugins that use these JA Ajax elements are
>> - warnings plugin
>> - forensics plugin
>> - autograding plugin
>>
>>
>> Am 19.05.2020 um 15:58 schrieb Aytunc Beken <aytuncbeken...@gmail.com>:
>>
>> I will check. Thanks!
>>
>> On Tuesday, May 19, 2020 at 3:57:27 PM UTC+2, Oleg Nenashev wrote:
>>>
>>> Jenkins Build History widget is probably the best example of AJAX usage
>>> in Jenkins:
>>>
>>>    - JAVA:
>>>    
>>> https://github.com/jenkinsci/jenkins/blob/449c5aced523a6e66fe3d6a804e5dbfd5c5c67c6/core/src/main/java/hudson/widgets/HistoryWidget.java#L210-L256
>>>    - Jelly with embedded JavaScriptL
>>>    
>>> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly#L79-L115
>>>
>>> BR, Oleg
>>>
>>> On Tuesday, May 19, 2020 at 3:35:15 PM UTC+2, Aytunc Beken wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am trying to implement Ajax call in UI page. I could only find this
>>>> page (
>>>> https://wiki.jenkins.io/display/JENKINS/AJAX+with+JavaScript+proxy)
>>>> however it did not worked.
>>>>
>>>> I will be glad if anyone can point some help.
>>>>
>>>> - Documentation
>>>> - Plugin implemented Ajax
>>>> - Plugin implemented Jquery
>>>>
>>>>
>>>> Thanks a lot.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/15189aee-5005-46a0-9569-36e24a70e02c%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/15189aee-5005-46a0-9569-36e24a70e02c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/2483942C-E728-4FF7-9D0C-23C983E64453%40gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/2483942C-E728-4FF7-9D0C-23C983E64453%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dus1HAE1dFi8EDp9UxCV645faY05fNz0Jjhhore%3DZBM4RA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dus1HAE1dFi8EDp9UxCV645faY05fNz0Jjhhore%3DZBM4RA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/8FFD60D6-E404-4F7A-A6D8-5D2FA973AFBA%40gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/8FFD60D6-E404-4F7A-A6D8-5D2FA973AFBA%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuvY6yKmHzvVzTh%3DphAF5ywUCyxmUxSdn3eNpp%3DGDnBKBQ%40mail.gmail.com.

Reply via email to