Solved

I have a problem with my js

Posted on 2009-04-06
9
342 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
9 Comments
 
LVL 12

Accepted Solution

by:
Dean OBrien earned 250 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
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 24076547
Are you intentionally using impossible to read layout?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 250 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now