FLEX - Load anglularJS URL content - actionscript-3

I need to load a URL (below) in my panel Flex but angularjs is not loading.
What is the solution?
<s:Panel id="panelHtml" x="0" y="22" width="100%" height="95%" enabled="false">
<mx:HTML id="content" location="https://www.arcgis.com/home/webmap/viewer.html"
width="100%" height="100%"
visible="true"
verticalScrollPolicy="auto" horizontalScrollPolicy="auto"
complete="content_completeHandler(event)"
locationChange="content_locationChangeHandler(event)"/>
</s:Panel>

The mx:HTML component is a pretty heavyweight custom implementation of a HTML Rendering Engine. As far as I know it doesn't use a browser, but handles everything itself. I think only parts of HTML, CSS and JavaScript are supported here.
As mx:HTML is only available in Air, I guess you are using this in an Air Application. I would suggest to have a look at the StageWebView class of Air. It's not that comfortable as the mx:HTML component is, but as far as I know this directly utilizes the systems default Browser. So it should be able to display more.

Related

How can I modify the web page produced by an external application without modifying the application?

I have the following problem: I have a frontend application A that authenticates, sets up a reverse proxy, and then forwards to a separate application B I don't control.
I would like to add decorations to the resulting page of the B application, for example adding a button "logout", but I can't modify B's code or templates.
Is there some magic trick I don't know about to obtain this result?
Your case, as discussed in the comments, leaves you open for a couple options:
Wrap application b inside an <iframe>
Load application b inside an <iframe>, while keeping a custom navigation bar in the top on a fixed position. This would be possible if the <iframe> is hosted on the same location as application b. This would avoid tampering with the original code of application b, while still giving you freedom to alter the user experience.
Example:
<iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" width="400" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
(variation on this):
<object data="http://www.web-source.net" width="600" height="400">
<embed src="http://www.web-source.net" width="600" height="400"> </embed>
Error: Embedded data could not be displayed.
</object>
Alternatively, this is a great related question with some viable solutions:
Alternative to iFrames with HTML5
Insert custom JavaScript / CSS inside application b
If you have control over the code of application b, you could include a small JavaScript file that automatically inserts some absolute elements to enhance the user experience. It would avoid to ruin the original code, but it's not really a clean solution
Modify the existing code
It's an option, but you shouldn't if you're not comfortable to edit it. Because you'll most likely waste a lot of time on it.
Good luck with your application!

.SWF Object Shrinking in IE 8

I am having an issue in WordPress. I've embedded a .swf as an object, but in IE 8 it shows really small. I've attached a screenshot of the IE issue. It's that really small picture on the left. To see a working version, check out the page here on another browser.
I would love to disregard this issue, but unfortunately our company runs on IE so I need to fix this.
This is all created in WordPress. The .swf is hosted externally. Here is the code:
<object width="680px" height="300px">
<param name="movie" value="http://www.pplweb.com/ppl-generation/~/media/PPLWeb/Generation/Media/PPL%20Susquehanna/nuclear.swf">
<embed src="http://www.pplweb.com/ppl-generation/~/media/PPLWeb/Generation/Media/PPL%20Susquehanna/nuclear.swf" width="100" height="100">
</embed>
</object>
Embed it using SWFObject, it's the most reliable way to insert SWF files. WordPress already comes bundled with it, so you just need wp_enqueue_script('swfobject');, and then use the script embedding accordingly.
Or you can use a plugin: wordpress.org/plugins/search.php?q=swfobject.

How can I detect the size of a WebView in the HTML using either CSS or Javascript?

We are building a Windows 8 app and we'd like to support the snapped view. Some of our content is loaded from 3rd party HTML pages where we embed a WebView in the XAML. Everything loads fine, but we'd like to take advantage of HTML5/CSS3 to detect dimensions and choose the appropriate CSS to render the page.
So our WebView looks something like this:
<WebView x:Name="_WebView"
Source="{Binding NavigationUri, Mode=OneWay}"
Width="275"
Height="200" />
This is just an example, but how can the HTML page know that the size of the window is 275px by 200px?
[Edited for better approach]
You could inject some Javascript from the C# side. See this MSDN thread for an example. Since you know the width of the control in your C# code, you can then easily set some variable or invoke a function.

Best Way To Place SVG Content Within HTML

From my research, i understand there are three ways to place an svg file inside HTML:
using embed:
<embed src="plot1.svg" width="500" height="320" type="image/svg+xml" />
using object:
<object data="plot1.svg" width="500" height="320" type="image/svg+xml" />
using iframe:
<iframe src="plot1.svg" width="500" height="320"> </iframe>
I've experimented with all three on a test rig (django built-in dev server, rendering the pages in Firefox 3.6). Under this obviously sterile environment, i haven't noticed any difference between the three--w/r/t performance or resolution.
My Question is whether one of these is better than the other two, and if so, which one. The answer might of course depend on the facts, which i've tried to limit to what's relevant:
We frequently display data (e.g, time series) on our website, usually created in response to some user action; based on that user action, a call is made to a database, the data returned is crunched and sent to the plotting engine, which renders a static image which is then embedded in the page--very standard stuff.
This works fine, but i would like to add some interactive features to these charts (e.g., tooltips, hyperlinked axis labels, highlighting a group of points w/in a plot). Some of the charts are fairly sophisticated (e.g., multi-panel conditioning) and i have not found a javascript chart library that includes these features. I finally settled on using the same plotting library (Lattice in R) but rendering each chart in svg and then adding the user-interaction features in a post-processing step, which consists essentially of javascript functions which manipulate the XML directly.
<embed> I would generally avoid. It's deprecated in HTML4, doesn't allow proper fallback content, and has had a selection of problems in IE.
<object> will allow you to include fallback HTML content for browsers without SVG support. <iframe> will fall back to prompting you to download the .svg file. Which of those is best probably depends on the application.
The other alternative, for modern browsers (including IE from version 9) is to serve your web page as application/xhtml+html and include the SVG elements in the page itself.
for me the best way is this
<svg id="circle" height="60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<image x="0" y="0" height="60" width="60" xlink:href="huge-red-circle.svg" />
</svg>
You can see the example here
source: http://edutechwiki.unige.ch/en/Using_SVG_with_HTML5_tutorial

Show PDF in a web

I want to display the contents of PDF file in a webpage. I don't want the browser to download when the user clicks.
Use the Google PDF Viewer:
<iframe src="http://docs.google.com/gview?url=URL_TO_YOUR_PDF&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
You could embed the adobe acrobat plugin inside your markup. Of course the user must have installed some the appropriate plugin in his browser for this to work. Another possibility is to set your server side script to send proper HTTP headers to instruct the browser embedding the file.
You aren't going to be able to control the browser config from the server side. Some people's browsers will be configured to show PDFs inline, and others won't.
What you can do (reading this as a programming question) is to convert the PDF to HTML and deliver the results. Apache PDFBox might prove useful for such an effort.
Use an <iframe>.
<iframe src="/url/to/file.pdf" width="500" height="300"></iframe>
Or an <object> when you're actually using XHTML.
<object data="/url/to/file.pdf" type="application/pdf" width="500" height="300">
alt : file.pdf
</object>
Note that the above is not supported by the ancient browsers, the above construct would let them degrade gracefully to a plain vanilla link.