Problem With <script> Tag Using Runat=server And Src Attributes
Jul 20, 2005
I am having a problem executing server side javascript.
For some reason the script tag is ignored when the runat=server is combined
with the src attribute. The code is being used client side also, so
embedding it right into the page is not an option.
I have also tried the following code without success.
<script language=javascript runat=server>
<!-- #include file="T.js" -->
</script>
The problem is issolated in the following example. Code:
View 1 Replies
ADVERTISEMENT
May 10, 2010
I'm trying to loop through a listbox that is runat="server" (to get all the values of the items inside the listbox regarless of if they are selected or not). Now i have searched for hours on end and still don't find anything (all the examples is just for the selected items....). What is a the correct way of doing this. O, i want to do it with jQuery preferably.
View 4 Replies
View Related
Oct 2, 2010
I have the following JavaScript (see below). The script requests an XML file from the server and displays it on the page.
The script works fine when the requested XML file is stored on the same server as the script.
The problem is when I try requesting an XML file from an external server such as the National Weather Service. I get an error. If I take the XML file from the National Weather Service and save it to my server it works. Why can't I use my script to request XML files stored on external servers?
Javascript Code
window.onload = initAll;
var xhr = false;
function initAll() {
document.getElementById("makeTextRequest").onclick = getNewFile;
[Code]....
View 8 Replies
View Related
Mar 11, 2010
I'm trying to write a script that will be loaded from one server into a website on another server. This script is trying to talk (ajax) to the server that it comes from but I'm getting "Access Denied" errors. I'm well aware that cross-domain calls are not allowed for security reasons so my question is how does Google Analytics work because essentially thats what I'm trying to accomplish. I can embed a Google Analytics script into my website and it'll gather data and send it back to Google.
View 4 Replies
View Related
Apr 19, 2010
I'd been looking for some way to get server date/time without using any server side script (such as ASP, PHP, etc).
I found this and it worked just excellent for me! I just want to share it because it wasn't easy to find.
I created a js document with code:
Code:
Now, I can use this js within a html like this:
HTML Code:
You may change your machine date/time and check both dates.
View 1 Replies
View Related
Feb 10, 2010
I would like to open an html file locally (not fetch it from a server) and somehow use javascript to fetch the relative resources from the server. One solution would be to convert all of the relative links to absolute links. I can convert the html source file anyway I wish, but ideally I would like to modify the html source as little as possible, for example insert a function that modifies the result of the src attribute. How would I go about this? Is there any trick I can use to define where the relative home is? Am I going to get into any scripting security gotchas?
View 3 Replies
View Related
Dec 31, 2006
I am creating an XML document on my page with javascript. My question
is, is it possible to save that xml file on the server (I have write
permissions) only using javascript, ie no server code? This task would
be trivial using server code, but I was wondering if I can do it all
with client code and post backs? Well, any input?
View 1 Replies
View Related
Dec 7, 2010
I already have a server connected to clients, clients send msgs and it echoes back to all of them and now i want when a client sends a msg it echoes on his server and the other server too .. so when any of the clients on any of the servers sends a msg it is broadcasted all over the servers to all clients
[Code]...
View 1 Replies
View Related
Jun 24, 2010
In ASP.Net, I am trying to create a WebControl. In this control, I have RenderControl method overridden with my html controls.
protected override void RenderContents(HtmlTextWriter output)
{
output.Write(@"<table><tr><td>");
[code]....
How can I make the button call the click event so that the server side method btnExecute_Click() can be called? Also, this button calls a javascript function before server side even.
View 5 Replies
View Related
Jan 23, 2011
how about getting the attributes of the a tag? href and title and the innerhtml (actually the innerhtml has space on both ends)
View 4 Replies
View Related
May 31, 2006
Is it possible to take an ASP textbox that has an attribute of
visible='hidden' and make it visible from javascript? I dont want it
to be visible until data on the page has been entered and thus need a
way to dynamically change its visibility?
View 3 Replies
View Related
Jul 20, 2005
Can someone tell me if there is a universal way to check the available
screen with and screen height for IE, Netscape, and Opera? Is there a
universal syntax?
View 5 Replies
View Related
Aug 17, 2010
I'm using a jquery plugin called jplayer. I need to "bookmark" the current track.
The only way to know the current file playing is to look at the div called jplayer_playlist_current.
<li class="jplayer_playlist_current">
<a href="#" id="jplayer_playlist_item_1" class="jplayer_playlist_current">Introduction and guidance on usage</a></li>
What I want to get from it is the id, ie: jplayer_playlist_item_1
I thought that this might cover it:
[URL]
But nothing I do, no amount of googling or plugins, is getting me this result.
View 4 Replies
View Related
Jun 14, 2010
I want to move a div around a page, and I do this by getting the original top and left values of a div, and then change them. But the problem is getting the original values; I checked online and thought that this would work:
var chart = document.getElementById(charDiv).style.top;
var charl = document.getElementById(charDiv).style.left;
alert('char_t:' + chart + ' char_l:' + charl + 'charDiv:' + charDiv);
charDiv is passed into the function (its the id of the div I want to move). I know that charDiv has a value by looking at the values of the alert() statement, but the values of chart and charl are empty. The alert simply outputs char_t: char_l: charDiv: charOne
View 1 Replies
View Related
Jul 17, 2010
I'm new at JS.
I need to remove TR elements from parent table but the problem is there are no table ID/Name
Is it possible to perform it?
Please see attach - i need remove red marked block... what scrip i have to use if i will put it to the green block?
View 3 Replies
View Related
Aug 12, 2011
I attempting to set attributes for all tags of a particular type....
I have a bunch of thumbnails <img> tags; when I wand over them I would like to show the corresponding large image with a script but the tags require onMouseOver events. I really don't feel like adding a bunch of onMouseOver="myShowScript" attributes to every img tag manually...
my scripts aren't working. I'm sure there is some fundamental concept about java and html I don't get...
here's ONE of the versions that doesn't work.. I've tried a few things but I'm open to scrapping everything for a better way...
function addAtts(){
var numberOf = document.getElementsByTagName("img");
for(i = 0; i < numberOf.length; i++){
numberOf[i].onMouseOver="myShowScript()";
}
}
View 9 Replies
View Related
Mar 11, 2011
I have this js function for pulling out a couple of links which I want to add onclick handlers to... but IE can't find the rel attribute the way Im doing it, Im assuming it can another way, but I dont know how?!this works in Chrome, but not IE... the category_links.length yields a fat 0.
function get_product_categories_links(){
var links = document.getElementsByTagName('a');
var category_links = [];
[code]....
View 5 Replies
View Related
Nov 23, 2005
I have an application where a user can create a newsletter with a
contenteditable div box and submit it to a database. The problem occurs
when the user tries to edit their newsletter. The edit page looks
exactly like the create page only their already created newsletter is
supposed to appear in the contenteditable div box. To do this I
retrieve the information from the database in the server side. Then I
have the following client side script.
window.onload=doInit
function doInit() {
var content = "<%=sContent%>";
div.innerHTML = content;
}
This seems to work in all cases except if the HTML to be displayed
contains any style attributes. For example, if any of the text has
background color then the HTML code will have the tag <font
style="bacground-color: #000000"> and this will cause nothing to appear
in the div box. Has anyone run into this problem or know how to fix it?
View 1 Replies
View Related
Mar 5, 2007
I have a web form with several "submit" buttons.
One of these uploads a file, and I want to validate the user input
prior to submitting the form. I have an event handler specified with
the form's "onsubmit" attribute which checks the the
event.target.value to make sure the right submission type is being
evaluated.
When I try to get the target or srcElement value from the event
object, however, it is always "undefined".
Here is the cut-down version of the handler...
function validateIfUpload() {
if (window.event) {
evt = window.event
} else if (document.event) {
evt = document.event
}
if (evt.target) targ = evt.target
else if (evt.srcElement) targ = evt.srcElement
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode
if (targ.value == "Upload") {
return validateUpload('prod_img_f')
}
return true
}
View 1 Replies
View Related
Jul 20, 2005
I'm having an issue with CSS, JS and the DOM. It's gonna drive me batty. I
am trying to access the properties of a layer in JS which have been
initially set in an external CSS. The problem is that for some reason JS
isn't receiving NULL for all the properties of the layer. For instance:
HTML
<div id="blarg">.....</div>
JS
var t = document.getElementById("blarg").style.left;
CSS
#blarg{
position: absolute;
left: 200px;
}
t == NULL and I can't figure out why. It is this way for any CSS attribute
I attempt to read (width, positional, the whole kit and caboodle).
It does work if I set the attribute in JS before I read it.
JS
document.getElementById("blarg").style.left = 30;
var t = document.getElementById("blarg").style.left;
t now == 30. The only thing I can think of to explain this is that when
the document gets loaded my layers aren't getting their attributes filled
out. The object gets created and the attribute fields are blank until I
fill them in. Thusly my creation of CSS's was a waste of time. Grr...
Any ideas/suggestions? Google has been of no help. :-( This is occurring in
IE 6, and the gecko engine browsers.
View 4 Replies
View Related
Sep 23, 2010
While trying out some of the code given in the book, I found that passing CSS properties and values in the jQuery is not working somehow. Following is what I have written.
$(document).ready(function() {
$('#first tbody tr:even').css('background-color': '#dddddd',
'color': '#666666',
'font-size': '11pt',
'line-height': '2.5em');
});
Where as if Ipass CSS properties infollowing way, it is working. But I would need to write multiple statements for that. $('#first tbody tr:even').css('color', '#873450');
View 2 Replies
View Related
Sep 6, 2011
If I have the following hyperlink :
<p><a href='page.htm' id='foo' class='bar' alt='alt text'>click</a></p>
I know that I can get (eg) the href attribute via $('a').attr('href') BUT I would like to do the following :
get *all* the attribute names and values without knowing anything about the attribute names and values in advance (or even how many there are) - something like a loop and $('a').(attribute name, attribute value). I suppose they would best be placed in a JavaScript object as a set of name/value pairs eg { href: 'page.htm', id: 'foo', alt: 'alt text' }
View 1 Replies
View Related
Apr 5, 2011
it has been a short time since i use jquery. I am now stuck on a problem with jquery- getting a xml node's all attributes as an array for example.. I have searched a lot on that with no luck Is there a way on getting all attributes of a node with jquery?
View 1 Replies
View Related
Jun 2, 2009
I am trying to get the color of an element and change the colorof another element with that color. Does this make sense?What is wrong with this? I would like all of the H1 tags to inherentthe color of ".ui-state-error".
$(function(){
var color = $('.ui-state-error').css('color');
$("H1").css({'color', ' + color + '});
[code]....
View 3 Replies
View Related
Aug 13, 2009
I need to be able to get the css attributes that a particular class defines. Such that if I have a class called "SomeClass" I want to see if it defines the attribute "position". I've tried using .css on an element that has the class, but of course that picks up the defaults and any inheritance.
View 2 Replies
View Related
Sep 28, 2009
If I have a tag image like this..
<span class="nodeLabelBox repTarget"><<span class="nodeTag">img</span><span
How to code this with jquery?
View 4 Replies
View Related