Page 1 of 1
Refresh HTML Object
Posted: Wed Jan 06, 2021 10:14 am
by ernesttan1976
Hi all,
I have a HTML object that I want to refresh with a new hyperlink.
I am using nuGetBreadcrumb(0), but this is too slow as it reloads the whole thing.
Is there another way I can reload only that HTML object?
Thanks.
Ernest
Re: Refresh HTML Object
Posted: Wed Jan 06, 2021 10:17 am
by ernesttan1976
Like this.
I choose from the dropdown. Cookie is updated inside the HTML link. Call nuGetBreadcrumb.
Takes 20 seconds.
Re: Refresh HTML Object
Posted: Wed Jan 06, 2021 11:02 am
by kev1n
I your URL looks like this:
Code: Select all
<a href="https://www.nubuilder.com" id="nuhttp">nuBuilder</a>
you can update it like this:
Code: Select all
$("#nuhttp").attr("href", "your_new_url_here");
Re: Refresh HTML Object
Posted: Fri Jan 08, 2021 4:42 am
by ernesttan1976
Hi Kevin,
Thanks for your answer.
Actually I refer to the HTML Object in the Nubuilder form. It is not a "A HREF" link.
I choose an item from the "Select Object"
Onclick event refreshes this "HTML Object" by calling nuGetBreadCrumb().
This nuGetBreadcrumb loads the whole page and takes too long.
I was wondering if there is anoher way to just refresh the HTML Object.
Many thanks for your help!

Re: Refresh HTML Object
Posted: Fri Jan 08, 2021 6:26 am
by kev1n
If I understand correctly, this would have the same effect:
1. Refresh the select object
2. Refresh the iframe src
Re: Refresh HTML Object
Posted: Sat Jan 09, 2021 2:58 am
by ernesttan1976
function refreshiframe(id){
var r = JSON.parse(JSON.stringify(nuSERVERRESPONSE));
var o = -1;
for(var i = 0 ; i < r.objects.length ; i++){
if(r.objects.id == id){
o = i;
}
}
if(o == -1){return;}
nuRUN(r, o, '', '', r);
}
Hi Kevin,
I inspected the page source, there is a function called refreshiframe, how do I call this function and get this iframe refreshed?
Ernest
Re: Refresh HTML Object
Posted: Sat Jan 09, 2021 8:21 am
by kev1n
refreshiframe() is not meant to be used for HTML objects, just for Run (Iframe) objects.
I added an onchange() event to the select object where the iframe src is changed:
select_change_iframe.gif
onchange event:
select_onchange.png
Code: Select all
$('#html_GoogleForm').find('#iframe_google').attr('src', $(this).val());
Give your iframe an id:
Re: Refresh HTML Object
Posted: Mon Jan 11, 2021 1:52 am
by ernesttan1976
Thank you very much Kevin, cheers!
Re: Refresh HTML Object
Posted: Mon Jan 11, 2021 4:15 am
by ernesttan1976
success! Thanks so much Kevin!
Re: Refresh HTML Object
Posted: Tue Jan 12, 2021 11:33 am
by kev1n
You're welcome!