Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I have a problem with my js

Posted on 2009-04-06
9
Medium Priority
?
381 Views
Last Modified: 2013-11-19
hi i don't seem to find the problem i looked it a 1000 times but don't seem to find the problem it don't works
var get = '<a href='javascript:(function(){var myDiv=document.createElement("div");myDiv.setAttribute("id","my_div");document.body.appendChild(myDiv);myDiv=document.getElementById("my_div");myDiv.innerHTML="<iframe frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" src=\"http://google.com\" width=\"1000\"height=\"1000\"> </iframe>";myDiv.style.position="absolute";myDiv.style.left="0px";myDiv.style.top="0px";})();'><button type="submit" " class="VIpriBtn"><span class="btn"><span class="btn">get &gt;</a></span></span>';
 
function b2(){r=t1.insertRow(3);c=r.insertCell(0);c.noWrap='nowrap';c.innerHTML = '<span class="title"><img src="http://google.com" alt="pix" align="middle"> price:</span>';c=r.insertCell(1);c.noWrap='nowrap';c.innerHTML = '<b>plm</b>';c=r.insertCell(2);c.noWrap = 'nowrap';c.innerHTML = ''+ get +'</button>';};

Open in new window

0
Comment
Question by:luckian121
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 12

Accepted Solution

by:
Dean OBrien earned 1000 total points
ID: 24075990
Its hard to comprehend what your trying to do with such badly laid out code... i spotted you were missing a space between your height and width declaration.

I fixed the first function to include the iFrame, wasnt sure what the 2nd one was trying to achieve....

Easynow
<HTML><HEAd><script>
function test()
{
	var myDiv=document.createElement("div");
	myDiv.setAttribute("id","my_div");
	document.body.appendChild(myDiv);
	myDiv=document.getElementById("my_div");
	myDiv.innerHTML='<iframe frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" src=\"http://google.com\" width=\"1000\" height=\"1000\"> </iframe>';
	myDiv.style.position="absolute";
	myDiv.style.left="0px";
	myDiv.style.top="0px";
}
 
 
function b2()
{
	r=t1.insertRow(3);
	c=r.insertCell(0);
	c.noWrap='nowrap';
	c.innerHTML = '<span class="title"><img src="http://google.com" alt="pix" align="middle"> price:</span>';
	c=r.insertCell(1);c.noWrap='nowrap';
	c.innerHTML = '<b>plm</b>';
	c=r.insertCell(2);
	c.noWrap = 'nowrap';
	c.innerHTML = ''+ get +'</button>';
}
</script>
<body onload="test();">
<p>content</p>
</body>
</html>

Open in new window

0
 

Author Comment

by:luckian121
ID: 24076371
no that didn't work
function b2(){r=t1.insertRow(3);c=r.insertCell(0);c.noWrap='nowrap';c.innerHTML = '<span class="get"><img src=15x54.gif" alt="get" align="middle"> price:</span>';c=r.insertCell(1);c.noWrap='nowrap';c.innerHTML = '<b>get</b>';c=r.insertCell(2);c.noWrap = 'nowrap';c.innerHTML = '<a href=\'javascript:(function(){var myDiv=document.createElement("div");myDiv.setAttribute("id","my_div");document.body.appendChild(myDiv);myDiv=document.getElementById("my_div");myDiv.innerHTML="<iframe frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" src=\"http://google.com\"width=\"1000\" height=\"1000\"></iframe>";myDiv.style.position="absolute";myDiv.style.left="0px";myDiv.style.top="0px";})();\'><button type="submit" " class="VIpriBtn"><span class="btn"><span class="btn">get &gt;</span></span></button></a>';};

Open in new window

0
 

Author Comment

by:luckian121
ID: 24076384
this one  looks good but it's not working... what I'm trying is to recode the page on load
function b2(){r=t1.insertRow(3);c=r.insertCell(0);c.noWrap='nowrap';c.innerHTML = '<span class="get"><img src=15x54.gif" alt="get" align="middle"> price:</span>';c=r.insertCell(1);c.noWrap='nowrap';c.innerHTML = '<b>get</b>';c=r.insertCell(2);c.noWrap = 'nowrap';c.innerHTML = '<a href=\'javascript:(function(){var myDiv=document.createElement("div");myDiv.setAttribute("id","my_div");document.body.appendChild(myDiv);myDiv=document.getElementById("my_div");myDiv.innerHTML="<iframe frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" src=\"http://google.com\"width=\"1000\" height=\"1000\"></iframe>";myDiv.style.position="absolute";myDiv.style.left="0px";myDiv.style.top="0px";})();\'><button type="submit" " class="VIpriBtn"><span class="btn"><span class="btn">get &gt;</span></span></button></a>';};

Open in new window

0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 12

Expert Comment

by:Dean OBrien
ID: 24076547
Are you intentionally using impossible to read layout?
0
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 24076618
Your functions refer to variables that dont appear to exist 't','c','r'...

Include you full code (with some attempt at spacing) else nobody can help you.
0
 

Author Comment

by:luckian121
ID: 24076657
never mind that i resolved it :D thanks anyway.

but do you know a function  something like this <a href=javascript:resize page>resize</a>
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 1000 total points
ID: 24076867
<a href="#" onClick="window.resizeTo(800,600); return false">Resize</a>
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 37169582
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question