|
How can I initailize array data to variable in JQuery. I want to initialize data from server-side instead of such as the following one.
var myVariable = ["ActionScript", "AppleScript", "Asp", "Scheme"];
-------------------------------------------------------------------
IN SERVER SIDE (cs file)
[System.Web.Services.WebMethod]
public static string MyFunction()
{
// This function return like this string array "ActionScript", "AppleScript", "Asp"....
// Return What? string array or string and how?
}
-------------------------------------------------------------------
I WANT TO CATCH STRING ARRAY ON ASPX (Callback)
<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url: "AutoComplete.aspx/MyFunction",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
????? how can I initialize data
var result = WHAT I DO...
Thanks....
modified on Tuesday, January 18, 2011 6:25 AM
|
|
|
|
|
How to do zoom in and zoom out for entire page in all browser. I know it can be done by pressing ctrl + key and ctrl - key. I want code in javascript.
Niladri
|
|
|
|
|
As far as im aware, there is no client-side scripting ability to control the browser zoom capability.
You could design your page in such a way that text/image/other visible element sizes could be controlled with Javascript, but there is no simple 1 line answer to this.
|
|
|
|
|
This is a feature of the browser itself, not JavaScript.
niladri03 wrote: I want code in javascript.
This is very rude. Don't just ask/demand code, we are not rent-a-coders. Show what you have tried and ask a specific question about what you need help with.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Why not put a wrapper round your whole page that has css properties of your page width/height and text size and image size etc. and then just adjust those values using javascript
|
|
|
|
|
I believe you you meant to reply to the OP not me. Nice idea but impractical and doesn't work as you think it does. There is a difference between enlarging an image and actually zooming the rendered output.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh yeah sorry and what is the difference? If all he wants to do is zoom the page then if you zoom in and make everything bigger it will be the same as zooming (scroll bars will give the desired scroll effect) and zooming out everything becomes smaller...where's the problem? If it was just zooming the individual image i'd see your point but as it's part of the whole page there isn't actually a difference, is there?
|
|
|
|
|
Yes, there is a difference. Your method is only enlarging, which in images may cause pixelation, with text may cause the layout to adjust, particularly if a flow style has been used. Zooming is accomplished with the bowser to redraw the content at a larger size.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh right okay yes that makes sense. Sorry my mistake. I tend to try and use layouts that are flow layouts but which are fully adjustable to max text-sizes and normally minimum of slightly smaller than 800x600 screens so that stuff like adjusting text-size doesn't matter...which is why I didn't notice it could create a problem with creating a zoom effect :/
|
|
|
|
|
is there any mechanism by which we can have gridivew in-place edit with jquery. if possible please give me sample code.
thanks
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: please give me sample code.
Again, don't just ask for code. Show that you have at least tried.
You don't need JQuery specifically to do in-place editing. There are plenty of examples using the built-in ASP.NET GridView and other third-party grids. Have you at least looked?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i worked with JQuery Modal Popup fine. how to attach a behaviour to Jquery Modal popup through javascript as a result when i will click out side of popup on my page the popup will close but if i click on modal popup then modal popup will not close. also please tell me how to add drop shadow in Jquery modal popup.please help me with code. thanks.
tbhattacharjee
|
|
|
|
|
First of all which JQuery Modal popup are you using, there are about a dozen plugins that do this. Modal dialogs are usually dismissed with a specific user action, such as clicking on an OK button. This prevents accidental clicks from dismissing the dialog and is the expected behavior of this functionality.
Tridip Bhattacharjee wrote: please help me with code.
Don't ask for code, its rude. Show what you have done and ask specific questions with what you need help with. Don't just ask for someone to do it for you.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I think you have misinterpreted the message. The question wasn't about which modal popup framework to use but rather which one the OP was using? I am very well acquainted with JQuery thank you.
I know the language. I've read a book. - _Madmatt
modified on Thursday, January 20, 2011 6:32 PM
|
|
|
|
|
Mark Nischalke wrote: mis-interrupted
It should be "misinterpreted" as his response was clearly an interruption.
|
|
|
|
|
I guess the spell checker mis-interruptted my misinterpreted
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I'm building a javascript code which will enable users to view a particular website within an iframe by typing it into a textbox.
I need some coding help.
Currently my code looks like this:
<br />
function gotourl() {<br />
<br />
self.frames['ifrm'].location.href = document.getElementById('url').value;<br />
document.location.href=redirecturl;<br />
}<br />
with ifrm being the id of my iframe and url being the text box.
When I type a web address into the text box, the javascript tries to load C:\Website\google.com which of course does not work.
I am new to javascript so any help would be greatly appreciated.
modified on Thursday, December 30, 2010 5:42 AM
|
|
|
|
|
Get the iframe you want to load the url into by its id and then set its source attribute "src" to the url you already fetched:
var iFrame = document.getElementById("ID_OF_YOUR_IFRAME");
iFrame.src = redirecturl; //where redirecturl is the url you build in your code
Cheers!
|
|
|
|
|
hi,
Did you include "http://" in the URL? Try http://google.com instead of google.com
|
|
|
|
|
Thanks, now I'm feeling like an idiot for not thinking of the obvious.
Cheers,
Dylan
|
|
|
|
|
Can i just trouble you once more?
How can i make the code insert http:// before the input text.
Cheers,
|
|
|
|
|
hello,
You can try something like below to append the "http://"
function gotourl() {
var url = document.getElementById('url').value;
if (url.length > 7) {
if (url.substring(0, 7) != "http://") {
url = "http://" + url;
}
}
self.frames['ifrm'].location.href = url ; //document.getElementById('url').value;
document.location.href=redirecturl;
}
|
|
|
|
|
don't forget "http://" is not the only protocol available for web pages (e.g. "https://").
I would be more inclined to check for the presence of "://" and if it is not present then I would add the "http://" prefix. If it is present then you could assume another protocol is used.
in the last example if someone entered "https://www.example.com" then you would end up trying to direct to "http://https://www.example.com" - which is of course invalid
EDIT: Actually meant to reply this to the OP
return 5;
|
|
|
|
|
yeah, I'm not worrying about it. The majority of people that will be using this site do not know any other protocols besides http; this is for a school website.
|
|
|
|