How to access parameters of URL in iframe?


Javier Munoz

I have the following HTML with jQuery code:

<div id="info" style="width: 100%; height: 280px; overflow-y: scroll;"></div>

var url1 = cbcWMS1.getGetFeatureInfoUrl
(evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'text/html'});

$('#info').append('<iframe width="99%" seamless src="' + url1 + '"</iframe>');

This string url1returns iframethe element in the table containing the element.

How to access elements in iframe?

I would like to add a condition that hides the entire condition using jQuery if iframethere is missing content .<div id='info'>

String: url1Contains the following code:

<body>
<table class="table table-hover table-condensed">
<h3>${type.name}</h3>
<head>
  <tr>
    <#list type.attributes as attribute>
      <#if !attribute.isGeometry> 
        <th>${attribute.name}</th> 
      </#if>
    </#list> 
  </tr>
</head>

<body>
  <#assign odd = false>
    <#if odd>
      <tr class="odd">
    <#else>
      <tr>
    </#if>
  <#assign odd = !odd>

  <#list features as feature>
    <#list feature.attributes as attribute>
      <#if !attribute.isGeometry>
        <td>${attribute.value}</td>
      </#if>
    </#list>
    </tr>
  </#list>
</body>

Javier Munoz

I have solved the problem by changing the following parts of the code:

{'INFO_FORMAT': 'text/html'}to {'INFO_FORMAT': 'application/json'}.

Now, the URL stands for JSONand HTML.

So it's definitely easier to inspect and work with the data.

Related


How to access parameters of URL in iframe?

Javier Munoz I have the following HTML with jQuery code: <div id="info" style="width: 100%; height: 280px; overflow-y: scroll;"></div> var url1 = cbcWMS1.getGetFeatureInfoUrl (evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'text/html'}); $('#in

How to access URL parameters in useEffect?

Beulah Akindele I have a functional component trying to access a URL parameter already named in react-router via a hook. useEffect(() => { document.title = props.match.params.subject UserServices.getSubject(props.match.params.subject) .then(resp

How to access URL parameters in useEffect?

Beulah Akindele I have a functional component trying to access a URL parameter already named in react-router via a hook. useEffect(() => { document.title = props.match.params.subject UserServices.getSubject(props.match.params.subject) .then(resp

How to access URL parameters in useEffect?

Beulah Akindele I have a functional component trying to access a URL parameter already named in react-router via a hook. useEffect(() => { document.title = props.match.params.subject UserServices.getSubject(props.match.params.subject) .then(resp

How to access URL parameters in useEffect?

Beulah Akindele I have a functional component trying to access a URL parameter already named in react-router via a hook. useEffect(() => { document.title = props.match.params.subject UserServices.getSubject(props.match.params.subject) .then(resp

How to access URL parameters in useEffect?

Beulah Akindele I have a functional component trying to access a URL parameter already named in react-router via a hook. useEffect(() => { document.title = props.match.params.subject UserServices.getSubject(props.match.params.subject) .then(resp

iFrame URL parameters in Wordpress?

hidden shark I have a page with an iframe that embeds an external page. i want to find zip code Here is my iframe: <iframe src="http://mortgagerates.icanbuy.com/?zip=" width="1020" height="1200"> http://mortgagerates.icanbuy.com/?zip=10458 (main site) But I w

iframe is not passing url parameters

Anthony Walters I am loading a webpage inside an iframe. If I load the page without the iframe, using the same url, it works as expected. However, if the iframe loads the url, it doesn't work. I've tried googling but can only seem to find how to pass variables

How to access URL parameters from BasePermission?

kale I'm trying to write custom rest_framework permissions to prevent users from querying information that is not in the same company as them. Unfortunately, I can't seem to access any URL parameters from has_permission()or has_object_permissions(). Here is th

How to access parameters from URL in cakephp 3

Anuj TBE In the cookbook for cakephp 3. Given the following command to build the URL echo $this->Url->build([ "controller" => "Posts", "action" => "view", "foo" => "bar" ]); will output as /posts/view/foo:bar How to access foo:barin action and sa

How to access url parameters on View::composer

user3207586 I want to receive the url parameters in the method View::composer but I don't know how to do it... This is in filters.php: View::composer('profile.followers', function($view){ dd($view->parameters); $view->with('menus', $menus); }); This i

How to access url parameters on View::composer

username I want to receive url parameter in method View::composerbut I don't know how to do it... This is in filters.php: View::composer('profile.followers', function($view){ dd($view->parameters); $view->with('menus', $menus); }); Here is my route: R

How to access URL parameters from BasePermission?

kale I'm trying to write custom rest_framework permissions to prevent users from querying information that is not in the same company as them. Unfortunately, I can't seem to access any URL parameters from has_permission()or has_object_permissions(). Here is th

How to access URL parameters in Meteor helper functions?

Noamyoungerm For some pages in my application, I want to enable printable mode, where some elements of the page are hidden when URL parameters are included ?print=true. For now, I've tried a workaround that involves sending the URL parameters as a data context

How to access URL parameters from BasePermission?

kale I'm trying to write custom rest_framework permissions to prevent users from querying information that is not in the same company as them. Unfortunately, I can't seem to access any URL parameters from has_permission()or has_object_permissions(). Here is th

How to access url parameters on View::composer

username I want to receive url parameter in method View::composerbut I don't know how to do it... This is in filters.php: View::composer('profile.followers', function($view){ dd($view->parameters); $view->with('menus', $menus); }); Here is my route: R

How to access Java enums as URL parameters in thyme?

Karsten I want to access Java enums in thymeleaf. I think it will work like this <a th:href="@{/(somekey=T(com.example.Myenum.FOO.getBaz()))}">my link</a> Unfortunately, that's not the case. I searched a lot of examples but couldn't find a solution, do you ha

How to access url parameters on View::composer

username I want to receive url parameter in method View::composerbut I don't know how to do it... This is in filters.php: View::composer('profile.followers', function($view){ dd($view->parameters); $view->with('menus', $menus); }); Here is my route: R

How to access URL parameters in Meteor helper functions?

Noamyoungerm For some pages in my application, I want to enable printable mode, where some elements of the page are hidden when URL parameters are included ?print=true. For now, I've tried a workaround that involves sending the URL parameters as a data context

How to access Java enums as URL parameters in thyme?

Karsten I want to access Java enums in thymeleaf. I think it will work like this <a th:href="@{/(somekey=T(com.example.Myenum.FOO.getBaz()))}">my link</a> Unfortunately, that's not the case. I searched a lot of examples but couldn't find a solution, do you ha

Pass URL parameters from iframe

Aaron I am hosting an iframe on my website which is served by a third party service. I cannot manipulate the source code of the iframe, which results in the user being able to navigate within the frame while the parent URL remains the same. E.g mysite.co.uk/ T

Access URL parameters in XSL

username I want to get the URL parameter from the URL of the current page in XSL and use it to test the condition in the template xpath. E.g: <xsl:apply-templates select="//search-results/orders/order[@id = URL Parameter]" mode="tableContent"/> I have no con

Access parameters from URL

George Patterson I am very new to Rails and ruby code. I have passed many parameters to the URL from link_to. However, when I try to access the parameter in _form.html.erb, I don't get any errors, but it doesn't output the parameter. Any help would be greatly

Access parameters from URL

George Patterson I am very new to Rails and ruby code. I have passed many parameters to the URL from link_to. However, when I try to access the parameter in _form.html.erb, I don't get any errors, but it doesn't output the parameter. Any help would be greatly

Access parameters from URL

George Patterson I am very new to Rails and ruby code. I have passed many parameters to the URL from link_to. However, when I try to access the parameter in _form.html.erb, I don't get any errors, but it doesn't output the parameter. Any help would be greatly