0

I have a wordpress page, where there is a div which contains a few dropdown lists and a button. Once button is clicked it retrieves the values from the dropdowns, results from database will display below. (calling another php file to query the results). From the results, each row would have a button to go to another page. (another php)

I want to be able to have these in another webpage where they could use as a 'widget'.

I tried loading the div from another webpage. and it did came out, but nothing happens when i clicked the button. (results from database should be displayed)

1 Answers1

1

Yes it's possible, you can do an iframe embed of those pages like this:

<iframe src="page_url_here" width="500" height="600"></iframe>

Your question is fairly easy to achieve but I recommend you to just create an integrated api instead of embedding the whole page, this method can help improve the loading time of the widget.

API example (JSON):

{
  "name": "widget name",
  "content": "widget content"
}

Then you can parse this json result with javascript to show a dynamic loading widget.

Norielle Cruz
  • 170
  • 5
  • 14