How can I have ajaxoptions included in the following form:
<form id="" action="<%=Url.Action("ChangePassword",new{Action="ChangePassword" }) %>" method="post" enctype="multipart/form-data">
Hey Guys,
I am having a hard time getting the rewrite rule setup correctly for my website&blog. Here is the current line in Apache's virtual host:
RewriteRule ^/(?:blog|apc|_em|phpsecinfo|blog/)/ - [L]
I am able to access my URL at www.domainname.com/blog/
But I am unable to access it at www.domainname.com/blog (without the ending /)
How can I edit my Rewrite rule so that I can reach the blog without the ending / ? Thanks
Hi! I am looking for method for parsing route path like this:
ActionController::Routing.new("post_path").parse
#=> {:controller => "posts", :action => "index"}
It should be opposite to url_for
Upd
I've found out:
http://stackoverflow.com/questions/2222522/what-is-the-opposite-of-url-for-in-rails-a-function-that-takes-a-path-and-genera
ActionController::Routing::Routes.recognize_path("/posts")
So now I need to convert posts_path into "/posts"
We've got Ultraseek 5.7 indexing the content on our corporate intranet site, and we'd like to make sure our web pages are being optimized for it.
Which SEO techniques are useful for Ultraseek, and where can I find documentation about these features?
Features I've considered implementing:
Make the title and first H1 contain the most valuable information about the page
Implement a sitemap.xml file
Ping the Ultraseek xpa interface when new content is added
Use "SEO-Friendly" URL strings
Add Meta keywords to the HTML pages.
For some reason, facebook's safe_image.php script isn't generating thumbnails, properly. It's generating a 1x1 image... even though the correct image is linked in the script's parameters.
Example:
<img class="img" alt="" src="https://s-external.ak.fbcdn.net
/safe_image.php?d=AQBtrCt_Es_KsED0&w=90&h=90&url=http%3A%2F
%2Fwww.southlapatriots.info%2Fimages%2FScamra%2FJayCastilleCouncil2.jpg"
The linked image is correct, but it is still only generating a 1x1 image.
Hi everyone,
I'm trying to create a simple thumbnail viewer with jQuery. Here goes the code:
$(function(){
$("ul.thumbnails li").click(function(e){
var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
$("img.featured").attr({ src: imgTitle , alt: imgAlt}); //Switch the main image (URL + alt tag)
});
<div class="image-gallery">
<img class="featured" src="big.jpg">
<ul class="thumbnails">
<li id="thumb01">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
<li id="thumb02">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
<li id="thumb03">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
</ul>
.thumbnails li {
margin: 0;
padding: 5px 5px 0 5px;
list-style: none;
float: left;
overflow: hidden;
}
thumbnails li img {
width: 50px;
height: 50px;
margin: 0;
padding: 0;
float: left;
}
If i click the thumbnail, the browser goes straight to the full image instead of just changing the img src with jQuery. But I if i click somewhere inside the <li> it works.
I know this must be simple, but I don't know where I'm going wrong. I've tried studying other galleries, like http://www.sohtanaka.com/web-design/examples/image-rotator/ , but couldn't find what I'm missing.
I could really use some help from you guys :)
I've created a custom Weblogic Security Authentication Provider on version 10.3 that includes a custom login module to validate users. As part of the provider, I've implemented the ServletAuthenticationFilter and added one filter. The filter acts as a common log on page for all the applications within the domain.
When we access any secured URLs by entering them in the address bar, this works fine in IE and Firefox. But when we bookmark the link in IE an odd thing happens. If I click the bookmark, you will see our log on page, then after you've successfully logged into the system the basic auth page will display, even though the user is already authenticated. This never happens in Firefox, only IE. It's also intermittent. 1 time out of 5 IE will correctly redirect and not show the basic auth window. Firefox and Opera will correctly redirect everytime. We've captured the response headers and compared the success and failures, they are identical.
final boolean isAuthenticated = authenticateUser(userName, password, req);
// Send user on to the original URL
if (isAuthenticated) {
res.sendRedirect(targetURL);
return;
}
As you can see, once the user is authenticated I do a redirect to the original URL. Is there a step I'm missing? The authenticateUser() method is taken verbatim from an example in Oracle's documents.
private boolean authenticateUser(final String userName, final String password, HttpServletRequest request) {
boolean results;
try {
ServletAuthentication.login(new CallbackHandler() {
@Override
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (Callback callback : callbacks) {
if (callback instanceof NameCallback) {
NameCallback nameCallback = (NameCallback) callback;
nameCallback.setName(userName);
}
if (callback instanceof PasswordCallback) {
PasswordCallback passwordCallback = (PasswordCallback) callback;
passwordCallback.setPassword(password.toCharArray());
}
}
}
}, request);
results = true;
} catch (LoginException e) {
results = false;
}
return results;
I am asking the question here because I don't know if the issue is with the Weblogic config or the code. If this question is more suited to ServerFault please let me know and I will post there.
It is odd that it works everytime in Firefox and Opera but not in Internet Explorer. I wish that not using Internet Explorer was an option but it is currently the company standard. Any help or direction would be appreciated. I have tested against IE 6 & 8 and deployed the custom provider on 3 different environments and I can still reproduce the bug.
Hi,
Is there any way that I can call my Java script function from css
for ex here is style:
.first-nav li a:hover,
.first-nav li.hover a {
margin:-3px 0 -1px;
height:30px;
position:relative;
background:url(../images/nav-hover.jpg) no-repeat;
}
and what I want to call a JS function on anchor hover
Hi All,
I am working on an application which needs to preview privileged content in the browser. The preview should work in a way that its NOT possible to download the content. Only reading within the browser is allowed. I have looked at google docs preview but it needs the url of the docs to accessible online. I need to work with content in the intranet
The previewer should not mandate the installation of a pluggin as this would limit the access.
Any hints
I've forked a Mercurial repository, and now I want to pull the changes from the main repository into my fork. If this were git, I would do something like...
git remote add upstream <url>
git pull upstream master
How do I do this sort of thing in Mercurial?
How do i do this in .NET? http://why.does.my.head.asplode.net/ I want to do something like ytmnd where each url is a different user generated page. I might need something as simple as pointing to a directory so dirname.mysite.com will redirect to http_public/userGenContent/dirname/
Hi,
I have a problem with NSURLConnection in my ad-hoc build
I'd like to log the problematic url. In debug version i can just output it to console. The question is how do i track it in ad-hoc? It's not about crashing, so crash logs will not help. Any ideas?
TIA
The following post indicates how to make a simple get http request with Erlang's inets.
exploring erlang's http client
Sometimes, URLs have GET parameters:
http://example.net/item?parameter1=12¶meter2=1431¶meter3=8765
Besides including the parameters in the URL itself, is there a way to create variables and then send them with the request?
Example appreciated.
Hi guys,
I am a noob with regards to this. I just wanted to know if a streaming server is necessary to play streaming videos on the iphone.
e.g. I have a couple of mp4's hosted on a server. Can i play those files directly using MPMoviePlayerController with the http://xxxx.xx.mp4 url??
Are there any commercial solutions for hosting videos for the iphone?
Thanks guys
Prasad Nair
I have been following this tutorial http://tinyurl.com/327p325 which has been GREAT up until this point where I can't get his code to work. I get the list working with static items but I can't get it to work with the json items. I've tried to simplify it with what I really want it to do to try and debug what is wrong (also if someone could please tell me how to view the Mojo log that would be awesome)
In the tutorial he has to use the yahoo service to convert the site into json data, while the site I want to interact with already has json data generated so this is what I have
PageAssistant.prototype.setup = function() {
this.myListModel = { items : [] };
this.myListAttr = {
itemTemplate: "page/itemTemplate",
renderLimit: 20,
};
this.controller.setupWidget("MyList",this.myListAttr,this.myListModel);
this.controller.setupWidget("search_divSpinner", { spinnerSize : "large" }, { spinning: true } );
};
PageAssistant.prototype.activate = function(event) {
this.getData();
};
PageAssistant.prototype.getData = function () {
// the spinner doesn't show up at all
$("search_divScrim").show();
var url = "http://www.website.com/.json";
var request = new Ajax.Request(url, {
method: 'get',
asynchronous: true,
evalJSON: "false",
onSuccess: this.parseResult.bind(this),
on0: function (ajaxResponse) {
// connection failed, typically because the server is overloaded or has gone down since the page loaded
Mojo.Log.error("Connection failed");
},
onFailure: function(response) {
// Request failed (404, that sort of thing)
Mojo.Log.error("Request failed");
},
onException: function(request, ex) {
// An exception was thrown
Mojo.Log.error("Exception");
},
});
}
PageAssistant.prototype.parseResult = function (transport){
var newData = [];
var theStuff=transport.responseText;
try {
var json = theStuff.evalJSON();
}
catch(e) {
Mojo.Log.error(e);
}
// this is where I believe I am wrong
for (j=0;j < json.data.count;j++) {
var thread=json.data.children[j];
newData[j] = {
title: thread.data.author
};
}
this.myListModel["items"] = newData;
this.controller.modelChanged(this.myListModel , this);
$("search_divScrim").hide();
}
So where I commented that I believe I am wrong I am just trying to get the title out of this json data
{
kind: Listing
data: {
children: [
{
kind: food
data: {
author: Foodmaster
hidden: false
title: You should eat this
}
},
// then it repeats with the kind: and data
Anyone see where I went wrong? I would like to know how to view the log as I have log events but can't figure out where to look to see if any of them are being thrown.
I have an array (for checkboxes) that I need to pass alongside the regular form in an ajax post, but can't seem to get this to work:
new_data = [a,b,c,d,e];
somedata_assoc = JQuery.param({'choices[]': new_data});
$.ajax({
type: "POST",
url: contract_qurl,
data: $(div).find("form").serialize()+"&"+somedata_assoc,
context: $(this),
success: function(data) { $("#results_table").html(data); }
});
I want to use jQuery to make a call to a c# web service called c.ashx which checks whether that username is valid and returns an error message as a string.
What should I put for data: and content type: if the return value of the c# webservice is a string value?
jQuery.ajax({
type: "GET",
url: "/services/CheckUserName.ashx",
data: "",
contenttype: "",
success: function (msg) {
alert("success");
},
error: function (msg, text) {
alert(text);
}
});
Is there any way to handle exceptions thrown from AJAX callbacks in jQuery, other than adding a try..catch block to each callback? The error function is not called in this situation.
$.ajax(
{
url: 'myurl.rails',
success: function( data )
{
throw 'Oh no!';
},
error: function ( xhr, textStatus, errorThrown )
{
console.log( 'AJAX call failed', xhr, textStatus, errorThrown );
}
} );
newbie question in css:
I have the following style defined:
TABLE.tabulardata th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
I want to create an identical style but with different background color.
question: is it possible to parameterize the attribute. Background color in this case Or do i need to copy the same style again
I think I have not got the syntax correct for writing a javascript function and calling it to assign its return value to a variable.
My function is:
getObjName(objId){
var objName ="";
$.ajax( {
type : "GET",
url : "Object",
dataType: 'json',
data : "objId="+objId,
success : function(data) {
objName = data;
}
});
return objName;
}
I am trying to call it and assign it to a variable with:
var objName = getObjName(objId);
However Eclipse is telling me that "the function getObjName(any) is undefined"
I need to write a string (URL) to the file system in the install override method in my Setup project custom action, and be able to read it at Uninstall. How can achieve this?
Thanks.
So I have a local URL like http://localhost:8090/feed1.ffm with live video stream in it. I need to send it over TCP to http://222.22.22.22:8090/feedReciver how to do such thing in WPF, C#?
I have a string in my db I want to pull into my page and convert to a json object.
[
{id: 1,title: "Long Event",
start: new Date(2009, 5, 6, 14, 0),end: new Date(2009, 5, 11)},
{id: 2,title: "Repeating Event",
start: new Date(2009, 5, 2)},
{id: 3,title: "Meeting",
start: new Date(2009, 5, 20, 9, 0)},
{id: 4,title: "Click for Facebook",
start: new Date(2009, 5, 27, 16),end: new Date(2009, 5, 29),
url: "http://facebook.com/"}
]
How can I do this using JQuery?