Solved

I have a problem with my js

Posted on 2009-04-06
9
369 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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

627 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