473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How can I keep javascript function from displaying in a new window?

I just found css code for a fixed menu at the top of the browser so the window under the menu can scroll right on without disturbing the menu. I used
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:CreateTable()"> </a>
but the table displayed in a new window and I want it to stay in the window that the menu is on. I was using a frame before but I couldn't get the table to display in the main window so now I thought with this CSS code, it would behave itself. Can anyone tell me what I need to do to get subs and functions to display in the menu window? It will be used in aspx.vb eventually
Jan 20 '16 #1
8 1392
Dormilich
8,658 Expert Mod 8TB
first thing is to not use a link when you do not want to link something. having the cursor change its shape can be easily done in CSS.

Expand|Select|Wrap|Line Numbers
  1. <span onclick="CreateTable()"> </span>
Jan 21 '16 #2
ok Thank you. Where in the code do I place <span onclick="CreateTable()"> </span>?
The menu has
Expand|Select|Wrap|Line Numbers
  1.  <ul>
  2.   <li><a class="active" href="#home">Home</a></li>
  3.   <li><a href="javascript:CreateTable()">Table</a></li>
  4.   <li><a href="#contact">Contact</a></li>
  5.   <li><a href="#about">About</a></li>
  6. </ul>
I didn't know how to submit the js function so I called a html file with CreateTable in javascript.
Jan 21 '16 #3
Dormilich
8,658 Expert Mod 8TB
where you had that link before.
Jan 21 '16 #4
It didn't show up as a menu item to click on.
Expand|Select|Wrap|Line Numbers
  1. <style>
  2. body {margin:0;}
  3. ul {list-style-type: none; margin: 0;  padding: 0; overflow: hidden; background-color: #333; position: fixed; top: 0; width: 100%;}
  4. li {float: left;}
  5. li a {display: block; color: white;  text-align: center;   padding: 14px 16px; text-decoration: none;}
  6. li a:hover:not(.active) { background-color: #111;}
  7. .active {background-color: #4CAF50;}
  8. </style>
  9. </head>
  10. <body>
  11. <ul>
  12.   <li><a class="active" href="#home">Home</a></li>
  13.   <li><span onclick="CreateTable()"></span></li>
  14.   <li><a href="#contact">Contact</a></li>
  15.   <li><a href="#about">About</a></li>
  16. </ul>
  17. <div style="padding:20px;margin-top:30px;background-color:#FFFFFF;height:1500px;">
  18. <h1>Fixed Top Navigation Bar</h1>
  19. <h2>Scroll this page to see the effect</h2>
  20. <h2>The navigation bar will stay at the top of the page while scrolling</h2>
  21. </div>
Jan 21 '16 #5
Dormilich
8,658 Expert Mod 8TB
well, a tag with no content in it certainly does not show.
Jan 21 '16 #6
I put Table in it and it didn't show up in the menu to be clicked. I have never used span before so I don't know the procedure. I just want a menu to display html table with 88 clickable cells. I have the table but can't get it to display in same window as menu.
Expand|Select|Wrap|Line Numbers
  1. <li><span onclick="CreateTable()">Table</span></li>
Jan 21 '16 #7
Dormilich
8,658 Expert Mod 8TB
do you have a live page for testing?

PS. you need to repeat the styling that you make for these <a> for the <span> as well
Jan 22 '16 #8
I use IIS 8 and have localhost to use a browser to run my code. I have aspx files and html files. html work fine except I end up with the html table with 88 cells in the frame and not in the main window just like it does in aspx.vb. code. I tried parent.main.location.CreateTable.html but it displays in the main window but the cells are not clickable so I can't use the next function which relies on which cell was clicked.
Jan 22 '16 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Filiz Duman | last post by:
Is it possible to call a javascript function based in the parent window from the child window ? I do open a pop up window from the parent window with: newwindow = window.open (...) and assign...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
3
by: John Bokma | last post by:
I have two windows in a frame. I want to be able that each can open a pop up window and that the handle to that window can be stored somewhere, so that each can talk to the pop up. is it...
6
by: szabelin | last post by:
Hello, I am trying to call a function inside the javascript block from asp.net during the postback (NOT button's OnClick event handler though). The javascript function creates new popup window. I...
3
by: MicroMoth | last post by:
Hi, I'm trying to call a Javascript function within a foreach loop. I am loop over a series of users and I want to call the JS function which opens a new window, passing in the user id to each...
1
by: jadeite100 | last post by:
Hi: I am using IE 6 SP2. My resize attribute does not work <body onresize="test1();">. When I resize my window, the resize event doesnot get call. I have a jsp page with an iFrame called...
1
by: jadeite100 | last post by:
Hi: I am having problem passing an xsl param variable as a parameter to a javascript function inside an xsl styelsheet. Here is my xsl stylesheet. I am trying to pass a variable called...
10
by: patelxxx | last post by:
Problem: I am trying to input my name in a text box and I click on transfer and I want the name to appear on the same page (i.e. in another form). How is this done? <BODY> <HTML> <form...
10
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
1
by: ngocham2001 | last post by:
Hello everybody, Please help me. I have a parent window, where is user input database into mySQL database, there is a select box to choose data from other table, if data is not exists. User press a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.