I'm working on a small code snippet.
PROBLEM: I click some buttons, click AJAX, click in the content in a single device.
I can work it properly, with images and text, but can not load with CSS and JS.
Example: Index Page:
& lt; Input type = "button" onclick = "example_ajax_request ()" value = "click my!" / & Gt; | & Lt; Input type = "button" onclick = "example_ajax_request2 ()" value = "or me!" / & Gt; & Lt; Div id = "example-placeholder" & gt; & Lt; P & gt; Placeholding text & lt; / P & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Function example_ajax_request () {$ ('# example-placeholder'). Html ('& lt; p & gt; img src = "image / loader.gif" width = "220" height = "19" /> '); $ ('# Example-placeholder') load ("fat.html") .; } & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Function example_ajax_request2 () {$ ('# example-placeholder'). Html ('& lt; p & gt; img src = "image / loader.gif" width = "220" height = "19" /> '); $ ('# Example-placeholder') load ("joined_today.html") .; } & Lt; / Script & gt; Page included_todem is a full blown webpage (which has a div element), and shadow AMCHARTS which clearly uses JS Inc. Raphael. Anyhoo, the issue arises, from any webpage with the header, the HTML and body tags above do not present these to the script.
So what I'm doing wrong, we can only load the div id in example_placeholder content which does not contain JS, or CSS
Is there a better way.
Essentially our scenario is this (I want to save from iFrames)
We have a web page and a content div, which has 3 buttons above the div. On clicking on each button, a chart is loaded with a chart (using the Amertts JS version) on the second button's click, the second chart first loads inside the chart etc.
Maybe I am going about it wrong, any help appreciated.
You will see & lt; Style & gt; , & lt; Link & gt; and & lt; Script & gt; tag at another location, e.g. & lt; Head & gt; or ; Script.type = 'text / javascript'; Script.src = 'somescript.js'; Document.getElementsByTagName ('head') [0] .appendChild (script); A potential problem is whether a file (CSS or JavaScript) has been inserted.
See this source for "." You may need to maintain a global listing to check whether a file is already included or not.
Comments
Post a Comment