473,799 Members | 3,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

echo? cout? what is it in JS?

5 New Member
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.p hp">Continue</a>
Else <a href="javascrip t:popUp('JSmedi a.php')">Contin ue</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 10733
ronverdonk
4,258 Recognized Expert Specialist
[HTML]document.write( '<a href="xxxxxxx"> xxxx</a>')[/HTML]

Ronald :cool:
Oct 23 '06 #2
Erind
5 New Member
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 New Member
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 Recognized Expert Top Contributor
popUp(JSMedia.p hp)

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
2179
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 refresh several times and it keeps happening. When I view page source, the last thing that shows up is the "...". The date doesn't print, nor does the closing the div tag.
6
2391
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 need to see some value. Example i have tables like this echo '<div align="',$align,'"><table border="0" cellpadding="2" cellspacing="0" width="',$largeur,'">'; echo '<tr><td bgcolor="',$titre_bgcolor,'"><font face="',$titre_face,'"...
19
1501
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. The statements like this: cout<<"something\n" ; should be made as
5
4008
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
7573
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 ) { COORD cur = { x, y }; SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), cur ); }
9
3423
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
2015
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 populated with the data from the query (in theory)!!! But I get a blank page! I have error reporting on php and mysql but nothing is displayed? <?php echo "<form method=\"post\" action=\"\" style=\"padding-left: 10px\">"; ...
58
4862
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" style and what the pros and cons are (I'm using cout as example, but it really applies to any similar construct): 1) using std::cout;
32
2656
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 use a php session cookie to stop the repeating of an embedded video file on a per session basis; i amended the php code to display a still pic if the session cookie value
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.