Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

$.afui.loadContent issue #919

Open
mrwrighty opened this issue Jun 29, 2016 · 4 comments
Open

$.afui.loadContent issue #919

mrwrighty opened this issue Jun 29, 2016 · 4 comments

Comments

@mrwrighty
Copy link

When trying to load a new page I get the following error:-

Uncaught TypeError: Cannot read property 'loadContent' of undefined
(Anonymous Function)

My code is:-

$.afui.loadContent("uib_page_1",false,false,"slide");

Also get error:-

Uncaught TypeError: Cannot read property 'getAttribute' of null appframework.ui.min.js:46
g.load Ajax appframework.ui.min.js:46
g.loadContent appframework.ui.min.js:41
(anonymous function) app.js:98

@icrisu
Copy link

icrisu commented Jul 25, 2016

I have a similar problem, loadContent does not seem to work properly:
$.afui.loadContent('#item'); af.ui.js:983 Uncaught TypeError: from.end(...).run is not a function(…)

the seems to come from line 983-> }).run(transition+"-out");

@icrisu
Copy link

icrisu commented Jul 25, 2016

I found the solution / workaround for this one, it seems that if you don't pass an anchor param to the loadContent method on line 667 it tries to create an anchor

anchor = anchor || document.createElement("a"); //Hack to allow passing in no anchor

however it fails, so what you need to do is pass the ID of an existing anchor from the dom, or create one than.

Basically you need to do something like:

AppetitMobileApp.prototype.openItem = function(itemID) { $.afui.loadContent("#item", false, false, 'up-reveal', '#test'); };

The last param "#test" is the ID of the anchor.

Cheers!

@GitCod-Man
Copy link

@icrisu I have the same problem! but when I pass the ID of an existing anchor and test it , loadContent does not seem to work properly: TypeError: anchor.getAttribute is not a function
var forceRefresh=anchor.getAttribute("data-refresh");
do you have this problem ?

@icrisu
Copy link

icrisu commented Aug 29, 2016

@GitCod-Man the above has worked for me, sorry I did not have your problem. As I recall I have dynamically created a div with an generated ID, and it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants