Im working on Anguar7 Project and i have the following difficulty.
I'm loading video player in a html file and this html file is located inside my asset folder.
Now i'm loading a component with iframe tag. inside to iframe tage i'm loading the above html.
Now i want to call a function from my component once that video is ended.
Related
I am migrating UIWebView to WKWebview.
While I could manage to migrate most of the workflows.
I am stuck at one workflow that I am not able to load the local file ("file://") via iframe from the html file in WKWebview.
It was working fine in UIWebView.
Also if iframe source is "web-url" and not local, it is working fine.
I am not seeing any error or any message on the console.
I read on few thread that loading local data in iFrame is broken in WKWebView, most probably because "allowReadAccesstoURL" setting which i am passing for main html is not passed to iframe correctly.
I wanted to check if there is a way to load local file via iframe.
It is disappointing that Apple has broken the functionality without providing proper alternative.
I am finally able to resolve it.
Issue was that the readAccess path for the "LoadFileUrl" was not inclusive of the url that was being loaded as iframe.
What was irritating is that console log did not give out any detail related to the error and I was not seeing any network call like decidepolicy or anything for the iframe loading, which caused the confusion.
I want to allow users to create HTML, CSS, and JS files and preview them. I give them the option to preview the HTML file in a WKWebView. I do this by passing the whole HTML file as a string to the WKWebView's loadHTMLString function in my Swift code.
If someone writes <script src="index.js"></script> within their HTML file being previewed, I want that to work. Where will WKWebView look for the index.js file? Should I be writing all 3 files to a temporary directory in iOS and letting WKWebView simply load the HTML file from there?
I have an iframe that uploads a file to rails
I want to respond back with javascript. The format that comes in is html
I tried
<script>
// JS code
</script>
But it loaded a new page and then executed the JS
Key is to upload a file asynchronously and then do more things on the page
Gem remotipart seems nice but i want to keep dependencies low
Look into Window.postMessage() for cross-origin communication. Refer to this post Html5 - Cross Browser Iframe postmessage - child to parent? to learn how to send child-to-parent page messages.
Recently, I've found this template from codyhouse which I decided to play with it a little in a sample rails app.
Looking into the code, I found that the page transition from the side navigation bar is happening via jquery load function.
From what I understand, whenever view, say user/show, gets loaded in rails, the contents written in the specified url, which in this case would be the contents in my user/show.html.erb file, gets embedded in the application.html.erb file.
As this is the case, I was wondering if there would be a way to "swap" contents being embedded into the application.html.erb file perhaps via jquery load function. For instance, without having to reload the whole view, replace the user/show.html.erb contents loaded in the page with the contents of user/signup.html.erb. Or is it not possible as it deviates from the concept of the MVC model?
Does rails disable use of a flash .swf file in a rails app by default, and is there a way to make it work?
I am trying to integrate the Wimpy Button MP3 player into pages of my Rails 3 app.
The MP3 player consists of a two files, wimpy_button.swf and wimpy_button.js. They need to go in the same directory.
I put them both in my /public/javascripts directory (the .js assumes the .swf is in the same directory)
I added the js to my layout (and verified the script src= is in my resulting html files)
= javascript_include_tag "wimpy_button.js"
(I also tried just hardwiring it with;)
<script src="/javacripts/wimpy_button.js" type="text/javascript"></script>
On a page, whereever I want an MP3 player button I have this javascript:
<script language="JavaScript" type="text/JavaScript">
writeWimpyButton("http://example.com/url_to_audio.mp3", "20", "20", "&displayRewindButton=yes");
</script>
On my static test pagein /public/testplayer it works fine.
But on any of the active pages, an empty space is where the player icon should be.
I assume the external content is being blocked by some security setting on rails?
Those files don't need to be in the same directory. Not sure which version of Rails 3 you're using, but you might be having a fight with the asset pipeline here.
Read more at: http://guides.rubyonrails.org/asset_pipeline.html
Then, put your swf in app/assets/flash and your js in app/assets/javascripts. Files will be available from your browser at /flash and /javascripts. You may need to edit the javascript to reference the correct location of your swf file.