473,386 Members | 1,753 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,386 software developers and data experts.

echo? cout? what is it in JS?

5
I have madea website, which is pretty unfortunate. I was originally messing around for about 2 days, and came up with a great layout. The bad side is that the background is 1030px. If screen width is greater than 1030 (1024) then it shows up as blank space. I came up with some javascript code based on the trusty google.com. I want:

If screen width is less than 1024, print <a href="JSmedia.php">Continue</a>
Else <a href="javascript:popUp('JSmedia.php')">Continue</a>

Expand|Select|Wrap|Line Numbers
  1. <script language='Javascript'>
  2. <!--
  3. windowheight=screen.height;
  4. function popUp(URL) {
  5. day = new Date();
  6. id = day.getTime();
  7. eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=1032,height="+ windowheight +",left = 125,top = 0,title=js');");
  8. }
  9. if (screen.width <=1024){
  10. --------------------------- 
  11. }
  12. else{
  13. ---------------------------
  14. }
  15. //-->
  16. </script>
  17.  
I don't know how to print/echo a link in javascript. the dashes represent the displayed links. That's where I am stuck.
Oct 23 '06 #1
4 10696
ronverdonk
4,258 Expert 4TB
[HTML]document.write('<a href="xxxxxxx">xxxx</a>')[/HTML]

Ronald :cool:
Oct 23 '06 #2
Erind
5
Not Working :(.

Expand|Select|Wrap|Line Numbers
  1. <script language='Javascript'>
  2. <!--
  3. bheight=screen.height;
  4.  
  5. function popUp(URL) {
  6. day = new Date();
  7. id = day.getTime();
  8. eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=1030,height=999,left = 125,top = 12.5');");
  9. }
  10. if (screen.width <=1024){
  11. document.write('<a href="JSMedia.php">regular</a>')
  12. }
  13. else{
  14. document.write('<a href="javascript:popUp(JSMedia.php);">popup</a>')
  15. }
  16. //-->
  17. </script>
  18.  
Oct 23 '06 #3
Erind
5
well, just the else document.write. I think its something to do with the href because it shows up as a link, just doesn't launch.
Oct 23 '06 #4
iam_clint
1,208 Expert 1GB
popUp(JSMedia.php)

needs to be
popUp("JSMedia.php")
or
popUp('JSMedia.php')
Oct 23 '06 #5

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

Similar topics

2
by: lawrence | last post by:
Right now, over at www.monkeyclaus.org, the following script is getting to the 9th run through and dying after the line: echo "..."; You'll admit that is a strange place to die. I've hit...
6
by: Marco | last post by:
I have a couple pages that have tables, whats best use echo to produce the full table with the variables or is it best to just make the table in plain html and use <?php echo ('$va'l); ?> when i...
19
by: qazmlp | last post by:
I hope comp.lang.c will not find the following question as a complete off-topic. I would like to remove ie.comment out the 'cout' statements during compilation(actually preprocessing) time. ...
5
by: Mastupristi | last post by:
I want to obtain the c++ equivalent of: unsigned short us = 347; printf("0x%04hX",us); that outputs "0x015B" I ried with: cout.setf(ios_base::hex,ios_base::basefield);
7
by: Joe C | last post by:
I'd like to have better control of text output to the console. I'm using Windows and have a little (non-standard) function to help me out: #include <windows.h> void locate(int x, int y ) {...
9
by: Domestos | last post by:
Here an unusual one... Say i am writing a few lines of code in php script as so... <?php echo '<table>'; echo '<tr>'; echo '<td> blah blah </td>'; echo '</tr>'; echo '</table>';
4
by: rawky1976 | last post by:
Hi, I have a hyperlink which goes to the page below and passes the PK_ID from a query into 'userid'. From this we query the DB and then echo a table with a form; only the textboxes are already...
58
by: Mark Casternoff | last post by:
I'm getting back into C++ after a long hiatus (they didn't have namespaces back then). I know this question is completely subjective, but I'd be interested in hearing which is the "better"...
32
by: Request-1 | last post by:
hi folks, html coder here, new and terrified * of php!! aaaaaa! i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. the conversion went well, it was to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.