This is for uploadify script for previewing an image that is uploaded, it creates the link fine, but won't trigger the function "del_image" unless I delete the parameters in the onclick, which leads me to believe it is something to do with my quoting. Here is the function:
I want to attach a js function to be called when a img is clicked and I'm changing the functions of onclick based on the image. I used setattribute but it doesn't works in IE. So I decided to use object.onclick = somefunction; but my functions are based on parameters and the whole function runs based on the passed parameter.
So I tried: like this object.onclick = "somefunction('"+mat+"')"; but doesn't work. I need a code which can attach the function on click event for both firefox and IE.
I am looking to do something with a few input boxes and a button that passes all of the input box values to a function but I can't get it to work. In IE when I try to send one of the values to an alert, it just says "[object]".
I am trying to pass dynamic String parameter to my javascript. The user enters sdome value and that is passed to the javascript as parameter. My problem is when user enters something of type cs204-1 or cs204.1 etc, the javascript does not run. On passsing simple parameters like cs204 or 111 etc, the javascript works fine. I need to pass any type of parameters to the javascript ( cs204-1 or cs204.1 etc) as I am making this for my college and the values to be entered by the user are of such type. My javascript code is : Code:
[Code]...
I tested the working of the javascript by using alert. It came for normal parameters but not for cs204-1 or cs204.1 types.
I am trying to pass dynamic String parameter to my javascript. The user enters sdome value and that is passed to the javascript as parameter. My problem is when user enters something of type cs204-1 or cs204.1 etc, the javascript does not run. On passing simple parameters like cs204 or 111 etc, the javascript works fine. I need to pass any type of parameters to the javascript ( cs204-1 or cs204.1 etc) as I am making this for my college and the values to be entered by the user are of such type.
My javascript code is : function deleteQuestion(id){ alert(id); questionId= eval("document.form1.deleteQ"+id+".value"); url='/DeleteQuestionServlet?questionId='+escape(questionId); document.form1.action=url; } I tested the working of the javascript by using alert. It came for normal parameters but not for cs204-1 or cs204.1 types.
I have an easy question, likely, that has me in a headspin. I have an include file to a frames based site that basically forces frames on the end user if they visit the site and hit a non-frames created page...
Simply, it is:
if (parent != self) self.parent.location.replace("/");
However, now I would like to force an inner frame to populate based on what frame someone was redirected from the include (above). So, if I visit http://domain/frame/innerframe_3.html, then I want to redirect to the above, but pass in /frame/innerframe_3.html to be included as a URL parameter for an inner frame to be populated.
When I modify this link to:
if (parent != self) self.parent.location.replace("/index.php?redir=" & location.href);
Then, the replaced location doesn't seem to recognize the ?redir= portion of the new location.
Is there a different way to do this? I can't use a META tag because I want the TARGET to be _TOP, basically.
My button when click call cal function, inside cal function I need to find parent so I can access other element, but I donot know how to pass parameter to Selectors/has(for some reason $("div :button").each(function()... no work here)
Code as below: function cal(event) { if (!event) event = window.event;
Hi all.Am new to this forum so cut me some slack if I don't articulate my problem with utmost clarity.My problem is that I have a javascript function such as:
function modReg(x,y) { <!-- var answer = confirm ("Do you really want to deregister user" +x+"?") if (answer) { document.leo["id"].value=x;
[Code]...
Now, leo is a hidden form with the 2 fields namely "id and "two".Viewing source, I see that the parameters I need are well acquired by the function.In next page, I haven't been successful at retrieving the passed parameters.
I have been checking out the following sitepoint tutorial on creating a plugin using Jquery http:[url]....I have some Questions about the selector and the parameters.Say for example, I wanted to pass parameters into the plugin:
And conversely if the plugin takes no parameters $(selector).MyPlugin(); Firstly is my understanding correct and secondly what if the plugin doesn't require a selector? What if it doesn't need to do anything to a given DOM element? would it be something like:
I am passing parameters via URL to my HTML form. The hardcoded hidden values work. Does anyone know how I can modify this so that the parameters can also write to the hidden values?code...
The problem is I keep getting an error along the lines of: TypeError: Result of expression 'house' [[object Object]] is not a constructor. It seemed to work when I wasn't passing the other objects as parameters in the constructor. I just created and assigned them later. As in:
I have an onclick function that pops a new window (nothing fancy) the problem is that whenever I want to return to the page where I popped the new window from I find that it is reloaded and has taken me to the fist line of the page. What parameter (or anything else for that matter) can I add in order to pop up a new window and still be in the same place when I return to the previous page?
Is there a way to do this for a while. Say I have a dynamic page that generates some td elements. The syntax here is freemarker but you can easily envision your favorite serverside text generating language instead.
<table id="records"> <thead><th>Name</th></thead> <tbody> [#list records as record] <tr> <td class="trigger" id="trigger_${record.ID}" onclick="showDetails (${record.ID})">${record.name}</td> </tr> [/#list] </tbody> </table> <script type="text/javascript"> function showDetails(recordID) { // normally an ajax post but you get the idea window.location = '/record?recordID=' + recordID } </script>
Now I want to get that onclick out of there and bind it using jquery, but I haven't been able to figure out if there is a way to get the parameter there. Apart from putting it in some attribute and looking at it. Is there a cleaner way?
<script type="text/javascript"> $(document).ready(function() { $('#records td.trigger').click(function() { window.location = '/record?recordID=' + ??? how do i get that }); }); </script>
I know I could look at the elements attributes, something like this.attr("id").substring().etc().etc() .. but sometimes there are many parameters to the javascript fn to generate the post and that approach doesn't seem to viable. and there isn't really a standard attribute to use that makes sense for that anyway.
I'm using the standard module pattern and the problem is once you set a private variable, trying to test that object independently becomes a nightmare as the next test is polluted by the actions of the previous.So, the options are to have some reset method (which is horrible), setters on everything (defeats the point) or delete object and re-load script (hideous).
I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.
I coudn't understand some behavior of RegExp.test function.
Example html code: ---------------- <html><head></head><body><script type="text/javascript"> var r = /^https?:///g; document.write( [ r.test('http://a'), r.test('http://b'), r.test('http://c'), r.test('http://d') ]); </script></body></html> ---------------------
The page displays true, false, true, false. (in Opera, Firefox and IE) This is strange because I expected it would display true, true, true, true. There must be something I didn't know about the function RegExp.test.
I am creating a simon says game, the game is based on 4 images (each has an opposite) when the game begins one of the image randomly flashes, the flash is between itself and its opposite (day and night). the user is then to mimic that flash by clicking on that image. If he clicks in that image then i want the move to be correct or 'true' if he clicks on another image i want the move to be incorrect 'false'. if false he will be redirected to an alert box thats says game over, if true then 2 of the images then flash as opposed to only one, again randomly. I am unsure how to test if it is correct or incorrect and then if correct get 2 of the images to flash randomly and so on. Can anyone help? please? here is what i have so far:
HAVE CLIENT-SIDE FORM COOKIE GET AND SET FUNCTIONS IN THE SECOND WINDOW DOCUMENT EXTERNAL JS.FILE OF A DUMY TEST SITE FOLDER ON MYCOMPUTER. IE8 THROWS 'SYNTAX ERROR' ON THE 'WINDOW.LOAD=FUNCTION, FIRST COOKIE FUNCTION HIGHLIGHTED'. CAN I ACTUALLY TEST COOKIES ON A TEST SITE ON MY COMPUTER WITHOUT THE SERVER (MYCOMPUTER) OR A DOMAIN NAME? YEAH NO HECKLING FROM THE PEANUT GALLERY.[code]...
I want to write a plugin, say 'myPlugin' which I can use like Code: $('#myID').myPlugin() ; $('#myID').myPlugin.test() ;
The plugin I wrote looks like Code: (function($){ $.fn.myPlugin = function() { // do something } $.fn.myPlugin.test = function() { var $this = $(this) ; // do something ; }})(jQuery) ;
This works and it doesn't work. It works because test() is called, but this is not the element with id '#myID' it is $.fn.myPlugin. To fix this I tried the following Code: (function($){ $.fn.myPlugin = function() { // do something } $.fn.myPlugin.prototype.test = function() { var $this = $(this) ; // do something ; }})(jQuery) ; but now the function 'test' is unknown.
I am making a function that executes code as AJAX readyState's are returned. If readyState = 3 then I running code through eval but I want to be able to run functions with parameters, within the parameter that is evetually executed by the eval
Heres abit of pseudo code of what I am talking about
function receiveRequest(whileLoading, whenDone) { // AJAX stuff... blah... blah... blah... if request is being processed: eval(whileLoading) if request is done: eval(whenDone)
[Code]...
I haven't used Javascript in agggeeesss and I can barely remember anything anymore - PHP <3