kuvalda
Posts: 0
Joined: Thu Oct 24, 2013 2:15 pm

Manipulating DOM using JQuery API

I am trying to manipulate the html DOM on my page using JQuery api when the page is loaded. I've added the following code to the Load event for my Home page (also tried adding it to the Page Show event).

I know the code is executing because I can see the alert box, however, the DOM is not modified. It's working fine outside of Appery. Can you please advise if I am doing something wrong here?

code
$(document).ready(function() {
alert($('#Home_panelMenu').html());
$('#Home_pageHeader').before($('#Home_panelMenu').html());
$('#Home_panelMenu').remove();
});
/code

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Manipulating DOM using JQuery API

Hi,

It's working. What do you want to do?

kuvalda
Posts: 0
Joined: Thu Oct 24, 2013 2:15 pm

Manipulating DOM using JQuery API

Sorry, not sure what you mean by "working"?

When I test my app in the browser and view the "frame source" in Chrome I can clearly see that the DOM is not modified... am I missing something here?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Manipulating DOM using JQuery API

Please post a public link to your app and tell in detail what exactly you want to do.

Jason Cheek
Posts: 0
Joined: Sun Jan 12, 2014 8:00 am

Manipulating DOM using JQuery API

Did you ever find a solution to this? I am having the same problem. I am trying to manipulate the DOM on a page show event with some very simple JQuery. The code is clearly executing but the DOM is clearly not modified in the least.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Manipulating DOM using JQuery API

Hello Jason,

Please tell us exact steps you have tried, so we can test..

Jason Cheek
Posts: 0
Joined: Sun Jan 12, 2014 8:00 am

Manipulating DOM using JQuery API

I have a List called listShifts, and when the app is loaded I get a JQuery handle like this:
var listShifts = Appery("listShifts");

And I have tried all of these, in and near the 'page show' event:
listShifts.append('...');
listShifts.text('...');
listShifts.html('...');

But the DOM has never changed in the slightest, regardless of the change I'm trying to make.

Though I just made some progress. It seems to work only if I call Appery('...') after the 'page show' event. Is it possible to manipulate the DOM in the background before showing the page to the user? Is this a restriction of the Appery('...') wrapper?

Return to “Issues”