Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  122] [ 6]  / answers: 1 / hits: 50424  / 10 Years ago, thu, march 27, 2014, 12:00:00

I realize that fundamentally I'm probably going about this the wrong way so I'm open to any pushes in the right direction.



I'm trying to use the HipChat API to send a notification to a room like so:



https://www.hipchat.com/docs/api/method/rooms/message



I'm trying to build the URL in the example with a js object's parameters, so basically I'm trying to convert this:



var hipChatSettings = {
format:json,
auth_token:token,
room_id: 1,
from: Notifications,
message: Message
}


To this:



https://api.hipchat.com/v1/rooms/message?format=json&auth_token=token&room_id=1&from=Notifications&message=Message


More From » jquery

 Answers
5

You should check this jQuery.param function.





var params = { width:1680, height:1050 };
var str = jQuery.param( params );
console.log(str);

<script src=https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js></script>




[#71759] Tuesday, March 25, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
myakylas

Total Points: 66
Total Questions: 85
Total Answers: 95

Location: Guadeloupe
Member since Sat, Aug 22, 2020
4 Years ago
myakylas questions
Thu, Apr 28, 22, 00:00, 2 Years ago
Thu, Apr 8, 21, 00:00, 3 Years ago
Sat, Sep 19, 20, 00:00, 4 Years ago
;