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

Condition insertion

Is it possible to make a file insertion conditional?

I now have the code
'<script type="text/javascript" src="http://www.site.com/showit.js">'

And I wondered if it is possible to make this conditional, something like:
if (mycondition==true) include('http://www.site.com/showit.js');

Thanks,

Wim
Jul 23 '05 #1
4 1427


Wim Roffal wrote:
Is it possible to make a file insertion conditional?

I now have the code
'<script type="text/javascript" src="http://www.site.com/showit.js">'

And I wondered if it is possible to make this conditional, something like:
if (mycondition==true) include('http://www.site.com/showit.js');


Don't you know document.write?
<script type="text/javascript">
if (mycondition) {
document.write(
'<script type="text/javascript" src="file.js"><\/script>');
}
</script>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2
Martin Honnen wrote:
Wim Roffal wrote:
And I wondered if it is possible to make this conditional, something like:
if (mycondition==true) include('http://www.site.com/showit.js');


Don't you know document.write?
<script type="text/javascript">
if (mycondition) {
document.write(
'<script type="text/javascript" src="file.js"><\/script>');
}
</script>


Note that this is likely to fail in NN4 due to the NRLB.
(I think we had this discussion before.)
PointedEars
Jul 23 '05 #3
Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> writes:
Note that this is likely to fail in NN4 due to the NRLB.


Do you have an English language refrence for this "NRLB"?

All I can find is:
<URL:http://gml-modul.sourceforge.net/cgi-bin/gmL?Sprache=en&domain=dhtml-tutorial&webpage=662>,
and even with google translation, I can't make much sense of it.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
Lasse Reichstein Nielsen wrote:
Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> writes:
Note that this is likely to fail in NN4 due to the NRLB.
Do you have an English language refrence for this "NRLB"?


Sorry, no.
All I can find is:
<URL:http://gml-modul.sourceforge.net/cgi-bin/gmL?Sprache=en&domain=dhtml-tutorial&webpage=662>,
and even with google translation, I can't make much sense of it.


Maybe you should ask Georg, he could possibly provide a proper
English explanation. I would like to provide it, but I have no
time for translating that document.
PointedEars
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in...
10
by: Anton.Nikiforov | last post by:
Dear all, i have a problem with insertion data and running post insert trigger on it. Preambula: there is a table named raw: ipsrc | cidr ipdst | cidr bytes | bigint time | timestamp...
5
by: John N. | last post by:
Hi All, Here I have a linked list each containing a char and is double linked. Then I have a pointer to an item in that list which is the current insertion point. In this funtion, the user...
4
by: Andrix | last post by:
Hi, I have a table with 20.000.000 of tuples. I have been monitoring the performance of the insertion and updates, but not convince me at all. The table have 30 columns, what and 12 of it, are...
0
by: polocar | last post by:
Hi, I have noticed a strange behaviour of CurrencyManager objects in C# (I use Visual Studio 2005 Professional Edition). Suppose that you have a SQL Server database with 2 tables called "Cities"...
6
by: barcaroller | last post by:
If I insert/remove an element in a set, will an iterator to this set automatically become invalid? Does the position of the iterator before the insertion/removal matter? How are vectors and...
3
by: kvnsmnsn | last post by:
I've been asked to overload the insertion operator. What exactly is the insertion operator in C++, and how would one overload it? I think that in C I could overload the "+" operator like so: ...
9
by: python_newbie | last post by:
I don't know this list is the right place for newbie questions. I try to implement insertion sort in pyhton. At first code there is no problem. But the second one ( i code it in the same pattern i...
2
by: rahullko05 | last post by:
I want to add a check condition to the column. I use the following script DROP TABLE IF EXISTS `Customer`; CREATE TABLE `Customer` ( `CustomerId` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.