Welcome Guest, Not a member yet? Register   Sign In
jQuery Drop Down Panel Integration
#1

[eluser]purpleparasol[/eluser]
Hi - I'm trying to use a jQuery plugin I found here. It creates a drop down panel on the top of a page. There is an example of the panel working here.

In one of the .js files supplied, you have to specify an HTML file in this line of javascript. It ends up being the content that appears on the drop down panel. In this case fred.html.
Code:
jkpanel.init(fred.html', '150px', 500);

I got it working in my CI web site initially by supplying this line :
Code:
jkpanel.init(BASE_URL+'system/application/assets/externalhtml/panelcontent.html', '150px', 500);
where BASE_URL was a javascript variable I set up earlier to be base_url() and panelcontent.html was just a text HTML file.

That would be all right if I wanted static content on the panel, but I want to supply a CI view, so that I can load panel content based on data from a database.

I tried supplying something like this but it didn't work.
Code:
jkpanel.init(BASE_URL+'index.php/publicuser/randomreview', '150px', 500);

The js code needs an HTML file to load into a div. How can I get to the resulting HTML file that the CI view & controller create so that I can specify it in the javascript, and therefore use a populated view as the content of my panel.
#2

[eluser]purpleparasol[/eluser]
Ah - I see my mistake. I tried testing the CI file spec for a controller/view using one of my existing views to see if it would work. It didn't. The problem wasn't the file specification - it was the content of the view - full of HTML and Javascript, which is what screwed it up. When I wrote a simple view that resulted in a js free html file, it all worked. Feel stupid now.




Theme © iAndrew 2016 - Forum software by © MyBB