Solved

I have a problem with my js

Posted on 2009-04-06
9
360 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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)

739 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