hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : How to add an iframe in a nodisplay javascript function?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

How to add an iframe in a nodisplay javascript function?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-01-2010, 01:21 PM
bambinou bambinou is offline
Web Hosting Master
 
Join Date: Aug 2008
Posts: 1,308

How to add an iframe in a nodisplay javascript function?


Hello,

I received a widget from a company, unfortunatly the widget only works in certain countries like USA,UK and Canada, this means that the rest of the world will see a blank page, I would like to have games showing instead of the blank page, any idea how to do this please?

First I have the widget code:
<script type="text/javascript">
widget = new Object();
widget.mnd_nodisplay = 'CONTENT ONLY AVAILABLE IN CERTAIN COUNTRIES!';
</script>

and woudl like to show this iframe instead of "content only available in certain countries"

<iframe
src="http://www.bonjourgames.com/bonjourgames.html" width="800"
height="800" frameborder="0" scrolling="no" marginheight="0"
marginwidth="0"></iframe>

I have tried this:
widget.mnd_nodisplay = '<iframe
src="http://www.bonjourgames.com/bonjourgames.html" width="800"
height="800" frameborder="0" scrolling="no" marginheight="0"
marginwidth="0"></iframe>';

but it will not work, any idea why please?

Thank you very much,


Ben

Reply With Quote


Sponsored Links
  #2  
Old 09-02-2010, 12:13 PM
Steve_Arm Steve_Arm is offline
Community Guide
 
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,479
Hi Ben, try this:

Code:
<script type="text/javascript">
  widget = new Object();
  widget.mnd_nodisplay = html_entities('<iframe src="http://www.bonjourgames.com/bonjourgames.html" width="800" height="800" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>');
function html_entities(str){return  str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
</script>

__________________


Reply With Quote
  #3  
Old 09-02-2010, 03:30 PM
bambinou bambinou is offline
Web Hosting Master
 
Join Date: Aug 2008
Posts: 1,308
Hi Steve,


Thanks for the reply,
I tried the code above but it did not work sorry.

I wanted to ask you something, are you working for this forum?
You answered so many of my questions in the past :-)


Thanks,


Ben

Reply With Quote
Sponsored Links
  #4  
Old 09-03-2010, 02:39 AM
Steve_Arm Steve_Arm is offline
Community Guide
 
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,479
No, I just help people.

Regarding your issue, I have checked and they don't display this string with innerHTML or
the write() method, because it should work. So I don't think you have much chances with it.

__________________


Reply With Quote
  #5  
Old 09-03-2010, 12:24 PM
bambinou bambinou is offline
Web Hosting Master
 
Join Date: Aug 2008
Posts: 1,308
Thanks Steve,

Nice to see you are helping a lot :-)

Have a nice day

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript iframe problem BurakUeda Programming Discussion 1 10-15-2007 05:32 AM
JavaScript Function NorthWest Programming Discussion 21 04-10-2006 04:06 PM
javascript function has no properties in javascript console mrblack Programming Discussion 2 05-25-2005 02:15 PM
[Javascript] Disabling the breaking of an Iframe! Barti1987 Programming Discussion 1 04-26-2005 03:29 PM
An add function in javascript CPower Web Design and Content 0 04-12-2005 01:25 PM

Related posts from TheWhir.com
Title Type Date Posted
The Startup Issue Magazine 2013-04-30 14:25:05
2013 Hottest Hosts Directory Magazine 2013-02-22 13:26:00
How to Launch a Product Magazine 2012-10-30 15:28:47
Web Host Tenzing Launches Service to Help Vendors Achieve PCI Compliance Web Hosting News 2012-04-25 12:20:16
Parallels “Cloud” Summit - It was all about TRUST Blog 2012-03-01 12:29:22


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?