Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
smartek
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2
Accepted Solution

how/where to use jquery with webworks and bbui?

[ Edited ]

hi, i have a small bbui and webworks app.

 

now i need to add some jQuery code but i dont know where to exactly add it. me want to add for example something like this:

$(document).ready(function () {
	$("#Div1").click(function () {
		alert("Hello world!");
	});
});

 i added this to my index.htm, but my code where the Div1 element is, is in a home.htm which is loaded via bb.pushScreen

 

its not working, do i have to add the jQuery code to every "screen" where i want to use it?

Plase "+Like" my post if it was helpful.
Please use plain text.
Trusted Contributor
usr501
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: how/where to use jquery with webworks and bbui?

Please use plain text.
Developer
smartek
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2

Re: how/where to use jquery with webworks and bbui?

I know where to place it in a "normal" jQuery page, but here the bb.pushScreen is special.

 

but i solved it now:

bb.pushScreen('home.htm', 'home');

 then i use the following:

ondomready: function(element, id) {
		if (id == 'home') {
			$("#Div1").click(function () {
				alert("Hello world!");
			});
		}
	}

 and it works :smileyhappy:

Plase "+Like" my post if it was helpful.
Please use plain text.