javascript - Using iframe body as Region in Backbone Marionette -


I am trying to use the body of an iframe in the background as a backbone merrynet. The Marianette StandAud uses jquery selectors to determine which element is the field, like this:

  App.addRegions ({main: "# main-region"});   

I want my area to be an integral part of an iframe, which normally I think:

  $ ('iframe'). ) .find ('body');   

When it is above the field, such as:

  App.addRegions ({main: $ ('iframe') .fund ( 'the body')});   

The following error has been thrown:

  Unwanted error: syntax error, unrecognized expression: iframe.contents () body Sizzle.error jquery.js? Body = 1: 4681 to counter jquery.js? Body = 1: 4742 choose jquery.js? Body = 1: 5114   

I tried to put the selector directly:

  app .addRegions ({main: "iframe.contents () body "});   

But this is giving me the exact same error.


Edit:

Also tried to create a psuedo-selector for this: $ Expr [":"] Content = $ Xp. Make Chaddo (Function (Selector) {Return Work (L) {var $ el; $ el = $ (el); Console.log ($ el.contents (). (Find selector); Return $ ($ el.contents (). Search (selector);};}); // Usage: $ ('iframe: content body');

In which function logs the body of iframe: prevObject: jquery.fn.jQuery.init [1], Reference: Iframe, Selector: ".contents () body", Constructor: function, init: functionâ |? | |

But ultimately the iframe element comes back in some way:

  [iframe, prevObject: jquery.fn.jQuery.init [1], sync B: Document, selector: "iframe: content (body)", constructor: function, init: function? |? | | |   

So, what I want is a selector

Is there any way to do this?

Definitely if you have yet answered the solution, but instead of creating the area you have to The beginner's selection can behave quite easily by relying on the behavior made in:

1) First you need to create a new area and el option as a DOM element

  var iframeRegion = new Backbone.Marionette.Region ({// Make sure that you call jQuery objects (eg .get) Dom receive the object. L: $ ('iframe'). material (). ('Body'). Get (0)});   

2) Then instead of using the selector string, your app was added:

  App.addRegions ({main: iframeRegion});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -