Comments (2)
You are using private functions (with underscore), which don't work as you would expect. Also, namespaces in XML are not ordinary attributes, you cannot get them to work properly by setAttribute. Just stick to the public methods:
var p = new JSJaCPresence();
var c = p.buildNode("c", {"xmlns": "http://jabber.org/protocol/caps"});
c.setAttribute("ver", "1.0");
c.setAttribute("node", "http://example.net/caps");
p.appendNode(c);
console.log(p.xml());
In case of IQ, the output is actually correct. You have created methodCall with empty namespace, so if it append to to an element with jabber:iq:rpc default namespace, empty xmlns is created. You must specifiy XML namespace for every element you create (as said above, XML namespaces are not simple attributes).
var iq = new JSJaCIQ();
iq.setType("set");
iq.setQuery("jabber:iq:rpc");
iq.getChild().appendChild(
iq.buildNode("methodCall", {"xmlns": "jabber:iq:rpc"}, [
iq.buildNode("methodName", {"xmlns": "jabber:iq:rpc"}, "foo"), []]));
console.log(iq.xml())
from jsjac.
Ahhh. I didn't know these ones. Thanks for your quick reply!
from jsjac.
Related Issues (20)
- unable to use JsJaC facebook chat client library to my web site ........ i read the read me in the JSJAC but have no idea about how to implement this client library in my website..... and how i can use this link to utilize bosh server "https://jappix.com HOT 4
- Unable to connect to OpenFire HOT 16
- Support method chaining for registerHandler
- get roster presence HOT 2
- jsjac simpleclient android app ( via phonegap ) , doesn't support websocket HOT 5
- XEPs and RFCs support page with version HOT 5
- Handle WebSocket stream termination HOT 1
- ondisconnect not being triggered HOT 1
- Latest release HOT 1
- 503 error HOT 1
- Send 'away' status on before unload event HOT 6
- In firefox doesn`t work adding users to roster. HOT 11
- Websockets Prebound session HOT 2
- Possible to not use cookie? HOT 2
- BOSH over websocket not work. HOT 2
- in Chrom v56.0.2924.87 (正式版本) (32 位) XMLHTTPReaust error HOT 1
- How to implement XEP-0163 PEP function in jsjac? HOT 6
- XMPP Core HOT 2
- Synchronous XMLHttpRequest on the main thread is deprecated
- Support XEP-0184: Message Delivery Receipts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsjac.